Ctrl-alt-L (cmd-alt-L) is my all-time favorite. It reformats the code consistently. It's the first thing I do when I start work on a new codebase, and the last thing I do before a commit. No need for endless discussions on which style is best, as the IDE allows you to set the preferences on a per-project basis. It can also read editor config dotfiles so you can use code formatting consistently throughout a team.
My Favorite Shortcuts for JetBrains' IDEs
21–30 of 71 posts
Re: My Favorite Shortcuts for JetBrains' IDEs
#22The JetBrains IDEs implement their own raw keyboard event handling, which means that if you have your system set up with a non-standard keyboard layout and JetBrains hasn't implemented their own support, it just won't work. The issue on their public issue tracker has been open for something like 8 years. Unfortunately for me this means that no keyboard shortcuts using the Cmd key work, despite me using a built-in mac…
I also use a built-in macOS keyboard layout with no special customisation, and I regularly use shortcuts with Cmd. Perhaps you might want to change your Keymap in IntelliJ(this can be done by Double Shift -> Type Keymap -> Select new value.
Edit: For me, almost all the shortcuts detailed in this post work, just need to replace Ctrl with Cmd.
Re: My Favorite Shortcuts for JetBrains' IDEs
#23While we talk about JetBrains, I think they really should push some priority on their remote development support. Take the VS Code Remote SSH extension as a good example of how it could work, which is extremely seamlessly, and it just works. E.g. even the embedded terminal provides a shell on the remote host, and if you e.g. open a file in there via `code somefile.txt`, it will open in your VS Code. It's basically th…
Re: My Favorite Shortcuts for JetBrains' IDEs
#24Re: My Favorite Shortcuts for JetBrains' IDEs
#25Ctrl-alt-L (cmd-alt-L) is my all-time favorite. It reformats the code consistently. It's the first thing I do when I start work on a new codebase, and the last thing I do before a commit. No need for endless discussions on which style is best, as the IDE allows you to set the preferences on a per-project basis. It can also read editor config dotfiles so you can use code formatting consistently throughout a team.
A potential next step if it fits your workflow is to create a macro triggered by save. I have one that optimizes imports, reformats code and do silent code cleanup.
Re: My Favorite Shortcuts for JetBrains' IDEs
#26Earlier quoted context omitted.
FWIW: In the 2020.1 updates that have been rolled out in the last week the SSH support is now much better. But serious question though: what workflow do you have that remote code editing is necessary?
I find remote code editing to be useful when I don't have the necessary resources on my machine such as disk/memory/gpu and I am still prototyping a solution, which happens a lot in ML/DL. I agree that remote code editing is not strictly necessary since you can perform such task with sshfs or git push/pull workflows. On the other hand, having the remote environment in your local IDE quickens the development and you d…
Also doing any Git action (git commit or so) over SSHFS is way too slow because it needs to go through the whole project directory. Maybe it's fine if the repo and project is smaller. But in this case, a Git commit can easily take a minute (while locally it takes a few milliseconds).
A Git push/pull workflow would also be quite annoying when you are prototyping and just want to try out things.
Re: My Favorite Shortcuts for JetBrains' IDEs
#27Earlier quoted context omitted.
A potential next step if it fits your workflow is to create a macro triggered by save. I have one that optimizes imports, reformats code and do silent code cleanup.
There is already an intellij plugin called Save Actions which does this (import, reformats, and some extra stuff, like adding final to variables wherever possible(optional off course).
Re: My Favorite Shortcuts for JetBrains' IDEs
#28Re: My Favorite Shortcuts for JetBrains' IDEs
#29The JetBrains IDEs implement their own raw keyboard event handling, which means that if you have your system set up with a non-standard keyboard layout and JetBrains hasn't implemented their own support, it just won't work. The issue on their public issue tracker has been open for something like 8 years. Unfortunately for me this means that no keyboard shortcuts using the Cmd key work, despite me using a built-in mac…
> despite me using a built-in macOS keyboard layout with no special customisation. I also use a built-in macOS keyboard layout with no special customisation, and I regularly use shortcuts with Cmd. Perhaps you might want to change your Keymap in IntelliJ(this can be done by Double Shift -> Type Keymap -> Select new value. Edit: For me, almost all the shortcuts detailed in this post work, just need to replace Ctrl wit…
Re: My Favorite Shortcuts for JetBrains' IDEs
#30- Not everybody uses a "standard" set of shortcuts (understandable); so whenever I need to do something on another's system, unless they're on "IntelliJ IDEA Classic" keymap, I'm clueless for a while.
- Not wanting to re-learn the "default" (shipped with) "macOS" keymap in case they change it again because of clashes with system shortcuts
- When switching to Linux (when my MBP just decides to limit all cores to 0.8GHz for thermals and I can get no work done), I have no idea what shortcuts are there. It's a hit-and-miss, hoping Cmd maps to Alt and it's the same combination. If it were possible to replicate the entirety of the Apple keymap on Linux, I'd switch to using IntelliJ IDEA on my beefier linux machine in an instant. (Oh and if there's a terminal configurable such that I can set up iTerm's shortcuts, bliss!)
- "complex" shortcuts, like Cmd-Shift-Option-N; afraid to remap it to something (moreso, figuring out what'd be the best remap option), afraid to hurt my little-finger the more I use that.