IntelliJ Idea Shortcuts

7 minute read

Shortcut Keys

LEGEND : Cmd   Shift   ^ Ctrl   Opt   Esc   Return  
Delete ↑ ↓ → ←

Help

Key Details  
⌘Cmd ⇧Shift A Find Action ⇧⇧ to open the same pop up

Live Templates

https://www.jetbrains.com/help/fleet/live-templates-list-java.html

View

Key Details
⇧Shift ⎋Esc Hide a tool window
⌘Cmd 0 Commit
✅ ⌘Cmd + 1 Project
⌘Cmd 2 Bookmarks Window
⌘Cmd 3 Find
⌘Cmd 4 Run
⌘Cmd 5 Debug
⌘Cmd 6 Problems
✅ ⌘Cmd 7 File Structure Tool Window, View -> Tool Windows -> Structure
⌘Cmd 8 Services
⌘Cmd 9 Git
⌥Opt F12 Terminal
⌃Ctrl ⌘Cmd F Enter Full Screen
✅ ⌘Cmd ⇧Shift I Quick Definition,See definition of a symbol at caret
✅ ⌃Ctrl ⇧Shift P View Type Info
⌃Ctrl ⇧Shift Q Context Info
F3 Bookmark Lines
⌘Cmd F3 See Bookmark Windows
✅ ⌘Cmd P View Parameter Infor
⌘Cmd + E Move to the last location edited ,Show recently opened Files etc.
⌘Cmd ⇧Shift + E See edited code in recently opened Files, Recent Locations
⌥Opt ⇧Shift C Recent Changes
⌘Cmd D Compare With…
✅ ⌃Ctrl `Backtick Quick Switch Scheme, enter presentation mode, etc
⌘Cmd ⇧Shift F7 Highlight All Usages
  • ✅ ⌘Cmd E Recent Files
  • ✅ ⌘Cmd E | Move to the last location edited ,Show recently opened Files 4.png

  • ✅ ⌘Cmd ⇧Shift E | See edited code in recently opened Files, Recent Locations 5.png

  • ✅ ⌘Cmd ⇧Shift I | Quick Definition,See definition of a symbol at caret 6.png

  • ⌘Cmd P | View Parameter Information 7.png

  • ✅ ⌃Ctrl ⇧Shift P | View Type Info 8.png

8.1.png

  • ✅ ⌃Ctrl `Backtick Quick Switch Scheme, enter presentation mode, etc

10.png

Key Details
✅ ⌘Cmd ⇧Shift ⌫Delete Last Edit Location, Jump back to previous edit
✅ ⌘Cmd ⌥Opt ← Back
⌘Cmd G Goto Line:Column
⇧ F2 Previous Highlighted Error
⌃ ↓ Next Method
⌃ ↑ Previous Method
✅ ⌘Cmd ⇧Shift M Move Caret to Matching Brace
✅ ⌘Cmd [ / ⌘Cmd ] Move through navigation history
⌘Cmd ⌥Opt . Custom Folding…
⌥Opt F1 Select In…
⌥Opt ↖ Jump to Navigation Bar
✅ ⌘Cmd B Declaration or Usages -> point, Hold Command key and left click
✅ ⌘Cmd ⌥Opt B Goto Implementation(s) -> point and left click
⌃Ctrl ⇧Shift B Type Declaration
⌘Cmd U Super Method
⌘Cmd ⇧Shift T Test
⌘Cmd ⌥Opt ↖ Related Symbol…
⌃ H Type Hierarchy
  • ✅ ⌃Ctrl ↓ Next Method / Class in package
  • ✅ ⌃Ctrl ↑ Previous Method / Class in package 13.png

Find, Search & Edit, Replace in Files

Key Details
⇧Shift ⇧Shift Find All -> Common entry point for all menu
✅ ⌘Cmd N Class (⌘Cmd ⇧Shift N -> File) (⌘Cmd ⇧Shift ⌥Opt N -> Symbol ) Can begin from ⇧⇧
✅ ⌘Cmd F Find in current file
✅ ^Ctrl ⇧Shift F Find in Files
⌘Cmd ⇧Shift F Find reference CHECK
W or ⌥Opt W Narrow search on Find While Searching, can be chosen from ⌘Cmd
⌘Cmd R Replace in current file
✅ ^Ctrl ⇧Shift R Replace in Files
✅ ⌘Cmd ⇧Shift V Paste from History…
⌘Cmd ⌥Opt ⇧Shift V Paste as Plain Text
F3 Find Next Occurrence
⇧Shift F3 Find Previous Occurrence
✅⌃Ctrl ⌘Cmd G Select All Occurrences
✅⌃Ctrl G Add Selection for Next Occurrence
⌃Ctrl ⇧Shift G Unselect Occurrence
⌘F3 Next Occurrence of the Word at Caret
⌘Cmd ⌥Opt X Find by XPath…
⌥Opt F7 Find Usage, Window for detailed view of usages -> Right click, Find usage
✅ Alt + F7 Find Usages, Find a method where its used -> Select method, right clik, choose find usages
⌘Cmd ⌥Opt ⇧Shift F7 Find Usages Settings…
✅ ⌘Cmd ⌥Opt F7 Show Usages
⌘Cmd F7 Find Usages in File
⌘Cmd ⇧ShiftF7 Highlight Usages in File
⌃⌥ ↓ Next Highlighted Usage
⌘Cmd ⌃Ctrl ⌥Opt ↑ Previous Highlighted Usage
✅ ⌘Cmd ⇧Shift 8 Column Selection Mode (Press twice to toggle)
⌥Opt ⇧Shift G Add Carets to Ends of Selected Lines
⌘Cmd W Extend Selection
⌘Cmd ⇧Shift W Shrink Selection
⌘Cmd ⇧Shift U Toggle Case
⌘Cmd ⌃Ctrl ⇧Shift J Join Lines
⌘Cmd D Duplicate Line
⇧Shift ⇥ Unindent Line or Selection
F11 Toggle Bookmark
⌘Cmd F11 Add Mnemonic Bookmark…
⇧Shift F11 Show Line Bookmarks…
⌃Ctrl ⌘Cmd ␣ Emoji & Symbols
  • ✅⌃Ctrl ⌘Cmd G | Select All Occurrences 3.png

Begin from ⇧⇧

  • ✅ ⇧Shift ⇧Shift Find All Common entry point for all menu
  • ✅ ⌘Cmd N Class
  • ⌘Cmd ⇧Shift N -> File
  • ⌘Cmd ⇧Shift ⌥Opt N -> Symbol 15.png

  • ✅ ^Ctrl ⇧Shift F | Find in Files 16.png

  • ✅ ⌘Cmd F | Find in current file 17.png

  • ✅ ⌘Cmd ⇧Shift V | Paste from History… 18.png

  • ✅⌃Ctrl ⌘Cmd G

Select All Occurrences Select and Right click opens menu

19.png

  • ✅ ⌘Cmd ⌥Opt F7 findUsages.png

Code

Key Details
✅ ⌘Cmd B Jump to declaration of method, Toggle by clicking twice
⌘Cmd O Override Methods
⌘Cmd I Implement Methods
⌃ N Generate
⌃ ␣ Basic
⌃Ctrl ⇧Shift ␣ Type-Matching
✅ ⌘Cmd ⇧Shift ↩ Complete Current Statement
⌥ / Cyclic Expand Word
⌥ ? Cyclic Expand Word (Backward)
⌘Cmd ⇧Shift ⌥Opt I Run Inspection by Name…
⌘Cmd ⇧Shift ⌥Opt H Configure Current File Analysis…
⌘Cmd J Insert Live Template…
⌘Cmd ⌥Opt T Surround With…
⌘Cmd ⇧Shift ⌦ Unwrap/Remove…
⌘Cmd + Expand
⌘Cmd ⌥Opt + Expand Recursively
⌘Cmd ⇧Shift + Expand All
⌘Cmd - Collapse
⌘Cmd ⌥Opt - Collapse Recursively
⌘Cmd ⇧Shift - Collapse All
⌘Cmd . Fold Selection / Remove region
⌘Cmd ⇧Shift . Fold Code Block
✅ ⌘Cmd / Comment with Line Comment
✅ ⌃ ? Comment with Block Comment
⌘Cmd ⌥Opt L Code Format - Selected Code and Entire File
⌘Cmd ⇧Shift ⌥Opt L Reformat File…
⌘Cmd ⌥Opt ⇧Shift L Reformatting Setting
⌘Cmd ⌥Opt I Auto-Indent Lines
⌘Cmd ⌥Opt O Optimize Imports
⌘Cmd ⇧Shift ↓ Move Statement Down
⌘Cmd ⇧Shift ↑ Move Statement Up
⌥Opt ⇧Shift ↓ Move Line Down
⌥Opt ⇧Shift ↑ Move Line Up
⌘Cmd ⇧Shift ⌥Opt K Convert Java File to Kotlin File
  • ✅ ⌘Cmd B Declaration or Usages of item
    • point, Hold Command key and left click
    • Just like moving into method definition(⌘Cmd ⌥Opt B )

14.png

Code selection

press ⌥Opt ↑/ ⌥Opt ↓to extend or shrink Selection

https://www.jetbrains.com/help/idea/working-with-source-code.html#editor_code_selection

Move Code Fragments

To move a line up or down, press ⌥Opt ⇧Shift ↑ or ⌥Opt ⇧Shift ↓ respectively.

To move (swap) a code element to the left or to the right, place the caret at it, or select it and press

  • ⌘Сmd ⌥Opt ⇧Shift ← for left or
  • ⌘Сmd ⌥Opt ⇧Shift → for right.
Collapse

Collapse a code fragment

  • ⌘Сmd - / ⌘Сmd = If you want to collapse all regions in the file
  • ⌘Сmd ⇧Shift - / ⌘Сmd ⇧Shift =

collapse.gif

Refactor

Key Details
^ Ctrl T Refactor This - Opens up all the options
⌘Cmd F6 Change Signature…
⌘Cmd ⌥Opt V Declare the variable
⌘Cmd ⌥Opt M Extract Method
⌘Cmd ⌥Opt C Extract Constant…
⌘Cmd ⌥Opt F Extract Field…
⌘Cmd ⌥Opt P Extract Parameter…
⌘Cmd ⇧Shift ⌥Opt P Functional Parameter…
⌘Cmd ⌥Opt N Inline Super Class…
F6 Move Members…
F5 Copy Class…
  • ✅ ^ Ctrl T | Refactor This - Opens up all the options below 1.png

  • ✅ ⌘Cmd ⌥Opt V | Declare the variable 2.png

Inheritance Hierarchy

Key Details
⌘Cmd ⌥Opt B See implementation of SomeInterface#foo
⌘Cmd U Navigate to super method
⌘Cmd ⇧Shift H See Hierarchy Window
⌘Cmd H See Class Hierarchy

Build, Run & Debug

Key Details
⌘Cmd + B Build
⌘F9 Build Project
⌘Cmd ⇧Shift F9 Recompile
⇧Shift F10 Run
⇧Shift F9 Debug
⌥Opt ⇧Shift F10 Run…
⌥Opt ⇧Shift F9 Debug…
⌥Opt ⇧Shift F5 Attach to Process…
⌘F8 Line Breakpoint
⌘Cmd ⇧Shift ⌥Opt F8 Temporary Line Breakpoint
⌘Cmd ⇧Shift F8 View Breakpoints…
⌘Cmd ⌥OptF6 Show Coverage Data…

Tools

Key Details
⌥Opt ⇧Shift T Switch Task
⌥Opt ⇧Shift N Open Task
⌥Opt ⇧Shift S Save Context
⌥Opt ⇧Shift X Clear Context

Window

Key Details
⌘Cmd M Maximize or unmaximize your current tab.
⌃ ⌘Cmd = Zoom In
⇧F12 Restore Default Layout
Hide Active Tool Window
⇧ ⌘Cmd F12 Hide All Windows
⇧ ⌘Cmd F4 Close Active Tab
F12 Jump to Last Tool Window
⌃ → Select Next Tab
⌃ ← Select Previous Tab
⌘Cmd F4 Close Tab
⌘Cmd , Preferences…
⌘Cmd H Hide IntelliJ IDEA ⌘Cmd ⌥Opt H Hide Others
⌘Cmd Q Quit IntelliJ IDEA
⌘Cmd ⌥Opt Q Quit and Close All Windows
  • ✅ ⌘Cmd F12 Display all methods in a file, on a pop-up window

  • Cmd⌘ 7 Structure 11.png

  • ✅ ⌘Cmd ⇧Shift - Collapse All
    • ⌘Cmd - Collapse
  • ✅ ⌘Cmd ⇧Shift + Expand All
    • ⌘Cmd + Expand

12.png

Coding Assistance

Key Details
⌘Cmd F1 See Warning Errors, Press twice for details
⌘Cmd J See documentation of a symbol at caret
  unmaximize your current tab.
⌘Cmd + K/^Ctrl Sh K Find instances fwd / backwards
⌘Cmd +⇧Shift+G Select an element and search its occurrences
⌘Cmd ⇧Shift O  
Surround with

Surround With ⌘Сmd ⌥Opt T surround_with.png

PDF Reference

This browser does not support PDFs. Please download the PDF to view it: Download PDF.

</embed>