Keyboard shortcut en IntelliJ IDEA

 


While the best way to avoid memorizing countless shortcuts is to create custom "quick lists" IntelliJ IDEA already provides several convenient built-in menus for common tasksAlt + G for Git tools, Alt + N for Navigation, Alt + R for refactoring, etc. These menus offer a great starting point for streamlining your workflow. However, for those looking to further enhance their productivity, here are some essential shortcuts to master:

Editor Basics

Commenting

  • Ctrl + / : Comment/uncomment single line
  • Ctrl + Shift + / : Block comment (/* ... */)

Code Surroundings

  • Ctrl + Alt + T : Surround selection with template code (e.g., try/catch, if/else)

Selection and Movement

  • Alt + J or ⌃G (macOS) : Select next occurrence of symbol
  • Ctrl + Alt + Shift + J : Select all occurrences in file
  • Ctrl + Shift + W : Shrink selection
  • Alt + Shift + Down/Up : Move line
  • Ctrl + Shift + Down/Up : Move entire method

Refactoring

Extracting Code

  • Ctrl + Alt + V : Extract local variable
  • Ctrl + Alt + M : Extract method

All Refactorings

  • Shift + Ctrl + Alt + T

Run and Debug

Run Configurations

  • Ctrl + Shift + A (then type "Edit Configurations") All configurations
  • Shift + Alt + F10 : All configurations

Debugging

  • Ctrl + F8 : Toggle breakpoint
  • Ctrl + Shift + F8 : View all breakpoints
  • Ctrl + Shift + Enter : Add to debug watch
  • Ctrl + Alt + F8 : Evaluate expression (quick evaluate expression for the selected argument)
  • Ctrl + F9 : Apply hot swap (rebuild without restart)
  • Ctrl + shift + A (reset frame) : Reset frame
  • ctrl + shift + A (mute breakpoints) : Mute breakpoints

Git Integration

  • Ctrl + Shift + Right Brace : Show branches
  • Ctrl + K : Commit tool window
  • Interactive Rebase: Fix (sort, for example) or squash (grouping) commits
  • Local History (IntelliJ Specific): Changelists and Shelves
  • Git blame : View line-by-line commit history
  • Alt + M : Ammend
  • Alt + G : All git tools

Code Assistance

  • Alt + Enter : Show context actions (quick fixes)
  • Alt + Enter + inject lenguaje or reference: inject lenguajes (json, html, etc.)
  • Right-click + Local History: Restore code fragments
  • Ctrl + Alt + L : Reformat code
  • Ctrl + Alt + Shift + L : Reformat code settings
  • Ctrl + P : View method signature
  • Ctrl + Shift + I : View symbol definition
  • F2 : Go to next error
  • Ctrl + F1 :  See a short description of warning or error
  • Ctrl + F1 (twice) : Expand the description of warning or error
  • alt + shift + enter : fix warning
  • Ctrl + Q : preview documentation

Code completation

  • Ctrl + Space : Basic completion (show list of items)
  • Ctrl + Space (twice) : Smart completion (show list of all items)
  • Ctrl + Shift + Enter : Complete statement like shoot
  • Ctrl + Shift + Space : See the list of matching suggestions (type-matching completion)
  • Type a dot "." after a expression : Completion suggestions
  • Ctrl + Alt + J : Sorround the selected code fragment with some live template
  • Ctrl + J : Insert live template

Navigation

  • Alt + W : Narrow search to whole words
  • Ctrl + Shift + R : Replace in path (all files after we can scope the limit)
  • Ctrl + F12 or Alt + 7 : View file structure
  • Ctrl + U : Navigate to super method
  • Ctrl + Shift + H : Method hierarchy
  • Ctrl + H : Class hierarchy
  • ctrl + E + Delete File : Delete from our recent files
  • Write prefixed (example rfd for RecentFileDemo.java) in search bar : Search
  • F3 : Find next occurrence
  • Ctrl + N : Search classes.
  • Ctrl + Space + Space : Lookup static members
  • Shift + Ctrl + F12 : Toggle all windows visibility
  • F12 : Jump to last tool window 
  • Shift + Ctrl + T : Test subject 
  • Ctrl + B :  Go to declaration
  • Ctrl + Alt + B : Go to implementation
  • Alt + F7 : Find usages
  • Ctrl + Alt + Left / Righ : Navigate back/forward in navigation history
  • Ctrl + Shift + Delete : Returns to the previous state with the unwrapping action 
  • Shift + Enter : Open in split view

References

  1. https://mobile.twitter.com/GuidesJava/status/1580061764145668096
  2. https://www.youtube.com/watch?v=ffBeoE6NBSs
  3. https://www.youtube.com/watch?v=Au6NTrpTr_o
  4. https://www.youtube.com/watch?v=2KYk45pJ7LY
  5. https://www.jetbrains.com/help/idea/reference-keymap-win-default.html#basic_editing
  6. Learn path of IntelliJ IDEA

Comentarios