Two years ago, a coworker wrote a Spin post on Seven JetBrains shortcuts. Once you get used to using them and combining them, they significantly improve workflow. So here are a few more I find useful, plus how you can use them together.
More JetBrains Shortcuts
Duplicate with ⌘D
⌘D is useful when you have a similar functionality within lines of code or functions. They can easily be duplicated with ⌘D, and it’s faster than doing a copy-paste.
Move Lines with ⌥⇧⇅
Sometimes you want to reorganize a few lines or shift some things around, but copy-paste is slow. Instead, you can move the lines using ⌥⇧⇅. This works on unselected lines and selected blocks.
Navigate to Start/End with ⌘⇄
To quickly move to the start or end of a line, use ⌘⇄. This is useful for selecting a full line or from start-to-cursor or cursor-to-end.
Navigate within a Line with ⌥⇄
Similarly, ⌥⇄ can be used for navigating within a line. This will move between words and can be combined with ⇧ for selecting the words you want.
Change Case with ⌘⇧U
This might not be used as much, but ⌘⇧U will change the case of the selected letters or the word the cursor is on. This can be quite powerful when editing multiple lines at once.
Format Code with ⌘⌥L
Things can occasionally get a little out of whack with code format. A quick ⌘⌥L will apply formatting to the selection (or to the file if nothing is selected).
Combine Shortcuts for a Better Workflow
Individually, the shortcuts shown here and in the previous post are very useful. But put together, they can greatly improve workflow.
Here’s an example showing duplication, caret cloning, word and line navigation, changing case, and code formatting.
The more you get in the habit of using shortcuts, the easier it will be and you find yourself using them a lot. What’s great about these shortcuts is that they’re the same for all JetBrains products. It really lends itself to using a single suite of IDEs instead of needing to learn shortcuts for many.
The display of the commands in the gifs was with a JetBrains plugin called Presentation Assistant.