Skip to end of metadata
Go to start of metadata


Keyboard shortcuts and various tips for IntelliJ IDEA. This document assumes IntelliJ on a Mac, using the Keymap setting for Mac OS X 10.5+ (in Preferences > Keymap). I know you can get all these through Help > Keymap Reference in IntelliJ, but I like to maintain my own list so that I can organize and search it the way I prefer, plus have a place to add my own additional notes.


Comment / uncomment selected textSelect block of text and then press Command + /
Spread selection from cursor (to word, then line, etc.)ALT + up arrow or down arrow
Format selected codeCTRL + ALT + I
Format all codeALT + CMD + L
Autocomplete method parameter infoCMD + P (when cursor is in method signature)
Invoke a Surround Template (ex: surround a line with try/catch)OPTION + CMD + T
Complete a statementSHIFT + CMD + ENTER
Import Java PackageHover over the red text of the class missing a package and press:

Live Templates

Live templates can be found in Preferences > Editor > Live Templates. Learn them!

To use a live template, enter its short text in the editor and then press tab to replace the short text with its template.


Tool Windows and Dialogs

ProjectCMD + 1
Version ControlCMD + 9
PreferencesCMD + ,
BreakpointsSHIFT + COMMAND + F8
Recent FilesCMD + E
Search EverywhereSHIFT + SHIFT
Search ClassesCMD + O
Search SymbolsOPTION + CMD + O
Navigate back and forth through recent filesCMD + [ and CMD + ]
New file (where selection is in Project window)


Note: you can use slashes to create entire trees abc/def/ghi/jkl...

Hide all other windowsSHIFT + CMD + F12
Stretch pane right or leftSHIFT + CMD + left or right arrow
Clipboard HistorySHIFT + CMD + V
Method List (of the active editor file)CMD + F12
Navigation Bar

CMD + up arrow

Note: This is particularly useful if you turn off the normal navigation bar in preferences to save UI space.

Action SearchSHIFT + CMD + A (try, for example, "RESTful Web Service")
Version Control Quick ListCTRL + V
Quick Switch SettingsCTRL + ~
Quick DocumentationCTRL + J (and then again to pin it open at larger size).

TO DO items

Create a TO DO item

  • CMD + / to create a new comment line
  • Type TODO then whatever comment you want

View all TO DO items

  • View > Tool Windows > TODO or
  • CMD + 6

Increase IntelliJ IDE memory on a Mac

  •  Help > Edit Custom VM Options...
  • Answer Yes to create the idea.vmoptions file. This will automatically create a copy of the .vmoptions file in the config folder and open a dialog to edit it.
  • I change -Xmx750m to -Xmx2048m


Write a comment…