Intellij Keyboard Shortcuts Cheat Sheet



Vim, VSCode & Intellij: A Rosetta Stone

In the last six months I’ve really started to adopt VS Code for editing on a regular basis. In the process, I realized how many shortcuts I’ve come to rely on in my goto editors, Vim and Intellij. Hence, here I list useful features that I exist across all three editors, as a reference to help in learning a consistent set of commands.

REMEMBER THESE SHORTCUTS Smart code completion Ctrl + Shift + Space Search everywhere Double Shift Show intention actions and quick-fixes Alt + Enter Generate code Alt + Ins Parameter info Ctrl + P Extend selection Ctrl + W Shrink selection Ctrl + Shift + W Recent files popup Ctrl + E Rename Shift + F6 GENERAL. Keyboard Shortcuts: Keymaps Comparison (Windows) Among all of the predefined keymaps, you will most probably choose one of the following: Visual Studio/ Visual Studio (OSX)— this keymap is recommended for users who.

Navigation

Download cheat sheet as printable PDF A5. Support: info@emmet.io Created with DocPad and Gulp.js Minimal theme by orderedlist. View page source on GitHub.

Moving by word

Vim

  • B/W (uppercase) to move back/forward for ‘real’ words separated by whitespace. It moves to the start of words
  • b/w (lowercase) works in the same way but treats words as being separated by any non alphanumeric character. Marginally more useful
  • E/e skips to the next end of word, as defined by whitespace/non-alphanumeric separators

Although all these shortcuts allow for very precise movement, and complete control, in 90+ percent of cases this is more complex than it needs to be.

Intellij - Option + <- / -> arrows

Navigation skips between the start and end character of each word. Like you are alternately pressing w and then e in vim. Normally this can be sufficient for what you need to do but it is a bit slow

VSCode - Option + <- / -> arrows

Very similar to how navigation works in Intellij, with a subtle but clever improvement. When you navigate forwards you move to the end of a word. When navigating backwards, you skip to the start of a word. This has the effect of making navigation quicker, as compared to intellij, but at the same time still making it easy to position your cursor at either the start or end of a word.

Move to start/end of line or document

Vim

  • 0/$ - start / end of line
  • gg/G - Move to first line/ last line. Cursor moves to the start of line in both cases

VSCode

  • fn + <- / -> - move to start / end of line
  • fn + up / down - move to top / bottom of visible page
  • cmd + <- / -> - ALTERNATIVE for moving to start / end of line
  • cmd + up / down - move to first line + first character / last line + last character of file
Intellij keyboard shortcuts cheat sheet mac

Intellij

Intellij Hotkey Cheat Sheet

  • fn + <- / -> - move to start or end of line
  • fn + up / down - move to top / bottom of visible page
  • cmd + <- / -> - ALTERNATIVE for moving to start / end of line

Goto line

Vim - :57 - go to line 57. You can also type 34| (number then pipe character) to move the cursor to the 34th character in a line (and this will be persisted as you move lines)

VSCode - ctrl + g, then type line number - move to line number. If you type ‘:

Intellij - cmd + l, then type line number to move to line. Moving to character works as in VSCode.

Move around by searching

Vim

  • /searchString - move to next match of the search string
  • n/N - move between next / previous matches
Intellij keyboard shortcuts cheat sheet download

VS Code

  • Ctrl + f - opens the search dialog. type searchString then Enter / Shift + Enter to move forwards / backwards through matches. THis also will find the next selection of selected text.

Intellij

Shortcuts
  • Cmd + f - as VS Code

Replace search matches

Vim

  • :%s/search/replacement/gc - inCremental string replacement starting from the beginning of the document (with sed).
  • :.,$s/search/replacement/gc - replace from the current line to the end of the file, rater than starting at the start of the file. You can customize this by changing . and $ to the start/finish line numbers you want
  • :%s/search/replacement/g - changes all matches without prompting for each

VSCode

  • Opt + Cmd + f - brings up replace dialog. Enter incrementally applies the replacement defined (only in the forwards direction). There is a button in the pop up box you can press to apply the replacement to all matches

Intellij

  • Cmd + r = brings up replace dialog. This works roughly the same as in VS Code.

Multicursor

Vim doesn’t have multicursor but does have more complicated alternatives to multicursor

VSCode:

  • Cmd + mouse click - spawns additional cursor at the mouse click
  • Cmd + up/down arrows - spawns additional cursors on the next/previous lines
  • Cmd + d spawns another cursor selecting the next instance of selected text
  • Cmd + shift + l selects all instances of the selected text

Intellij:

Intellij Keyboard Shortcuts Windows

  • Opt + shift + mouse click - spawns additional cursor at the mouse click
  • Spawning additional cursors on lines above or below is something intellij understands but it doesn’t by default have a keyboard shortcut
  • Ctrl + g spawns another cursor selecting the next instance of selected text
  • Ctrl + Cmd + g selects all instances of the selected text

Meta (shortcuts for finding shortcuts)

Vi

  • :help - list of topics of of to use vim effectively
  • :help <topic-ref> - access the help for a particular topic
  • :w + <prefix> tab allows you to complete/select commands from a prefix. I find this to be more useful after setting :set wildmenu so that all possible completions are visible

VSCode

  • F1 - search for actions (not only those mapped to keyboard shortcuts)
  • Cmd + k, followed by Cmd + r - open the keymap reference
  • Cmd + k, followed by Cmd + s - open all keyboard shortcuts to view or edit

Intellij

  • Cmd + Shift + A - search for actions (not only those mapped to keyboard shortcuts)
  • Keymap reference can be found in the help menu, there is no shortcut
  • Similarly, the complete keymap for viewing or editing is found in the preferences menu

I’ve found this cheatsheet to be the best way to learn all the secret shortcuts in Resharper that really help to speed up development in Visual Studio and make life easier. For months I had it pinned to my cube wall until I used them so much they’re muscle memory.

Intellij Idea Keyboard Shortcuts

If you are coming from a JAVA background and have been using IntelliJ IDEA, use this:
http://www.jetbrains.com/resharper/docs/ReSharper90DefaultKeymap_IDEA_scheme.pdf

If you are like me and a hard core visual studio user, use this:
http://www.jetbrains.com/resharper/docs/ReSharper90DefaultKeymap_VS_scheme.pdf

If you want to change your shortcut scheme (or you aren’t sure what it’s set to), in the Visual Studio top menu go to Resharper –> Options –> Keyboard & Menus, then select “Visual Studio” or “Resharper 2.x or IntelliJ IDEA” and Apply Scheme and Save. Then hit a shortcut like Ctrl+Shift+N and a menu pops up saying there’s a conflict in shortcuts and asks which scheme do you want to use. Select “Visual Studio” or “Resharper 2.x or IntelliJ IDEA” and check the Apply to All. You can switch to the other schema at any time.

Here’s an image for the visual studio layout.

Keyboard Intellij Shortcuts

Related