Skip to main content
Useful IntelliJ IDEA Shortcuts
  1. Posts/

Useful IntelliJ IDEA Shortcuts

·324 words·2 mins·
Roman
Author
Roman
Photographer with MSci in Computer Science and a Home Lab obsession
Table of Contents

A collection of essential keyboard shortcuts (for Mac only for now) to boost your productivity in IntelliJ IDEA. I’ll keep this updated as I discover more useful shortcuts.

Editing
#

  • ⌃Space - Basic code completion
  • ⌥Enter - Show intention actions and quick-fixes
  • ⌥⌘L - Reformat code
  • ⌘D - Duplicate current line or selection
  • ⌘⌫ - Delete line at caret
  • ⌘/ - Comment/uncomment with line comment
  • ⌥⌘/ - Comment/uncomment with block comment
  • Shift + ↑/↓ - Select multiple lines
  • Shift + Alt + ↑/↓ - Move selected lines up/down
  • ⌃G - Add next occurrence
  • ⌃⌘G - Select all occurrences
  • ⌥↩(Enter) - open intention action menu
    • Add type annotation to function definition
    • Change access modifier
    • Open Github copilot inline chat
    • Add Scala Doc
  • Tab - Jump to the right past closing characters (when cursor is inside quotes, brackets, or braces)
  • ⌘ + → - Moves to the end of the line

Navigation #

  • ⌘O - Go to class
  • ⇧⌘O - Go to file
  • F12 - Jump to last tool window
  • Esc - Return to editor from tool window
  • ⌘L - Go to line
  • ⌘E - Recent files popup
  • ⌥F7 - Find usages
  • ⌘B - Go to declaration

Search/Replace
#

  • ⇧⇧ - Search everywhere (double-tap shift)
  • ⌘F - Find
  • ⌘R - Replace
  • ⇧⌘F - Find in path
  • ⇧⌘R - Replace in path

Refactoring
#

  • ⇧F6 - Rename
  • ⌥⌘M - Extract method
  • ⌥⌘V - Extract variable
  • ⌥⌘F - Extract field
  • ⌥⌘C - Extract constant
  • ⌃⌥O - Optimize imports

Running & Debugging
#

  • ⌃R - Run
  • ⌃D - Debug
  • F8 - Step over
  • F7 - Step into
  • ⌥⌘R - Resume program
  • ⌘F8 - Toggle breakpoint
  • ⇧⌘F8 - View breakpoints

Windows Management
#

  • ⌘1, ⌘2... - Open corresponding tool window
  • ⌃Tab - Switch between tabs and tool windows
  • ⇧⌘' - Maximize/restore editor
  • ⌘[ - Navigate back
  • ⌘] - Navigate forward

Productivity Boosters
#

  • ⌃⌥H - Call hierarchy
  • ⌘F12 - File structure popup
  • ⌘7 - To open File Structure side window