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 tasks: Alt + 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 lineCtrl + 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 symbolCtrl + Alt + Shift + J
: Select all occurrences in fileCtrl + Shift + W
: Shrink selectionAlt + Shift + Down/Up
: Move lineCtrl + Shift + Down/Up
: Move entire method
Refactoring
Extracting Code
Ctrl + Alt + V
: Extract local variableCtrl + 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 breakpointCtrl + Shift + F8
: View all breakpointsCtrl + Shift + Enter
: Add to debug watchCtrl + 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 framectrl + shift + A (mute breakpoints)
: Mute breakpoints
Git Integration
Ctrl + Shift + Right Brace
: Show branchesCtrl + 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 historyAlt + M
: AmmendAlt + 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 codeCtrl + Alt + Shift + L
: Reformat code settingsCtrl + P
: View method signatureCtrl + Shift + I
: View symbol definitionF2
: 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 shootCtrl + Shift + Space
: See the list of matching suggestions (type-matching completion)Type a dot "." after a expression
: Completion suggestionsCtrl + Alt + J
: Sorround the selected code fragment with some live templateCtrl + J
: Insert live template
Navigation
Alt + W
: Narrow search to whole wordsCtrl + Shift + R
: Replace in path (all files after we can scope the limit)Ctrl + F12
orAlt + 7
: View file structureCtrl + U
: Navigate to super methodCtrl + Shift + H
: Method hierarchyCtrl + H
: Class hierarchyctrl + E + Delete File
: Delete from our recent filesWrite prefixed (example rfd for RecentFileDemo.java) in search bar
: SearchF3
: Find next occurrenceCtrl + N
: Search classes.Ctrl + Space + Space
: Lookup static membersShift + Ctrl + F12
: Toggle all windows visibilityF12
: Jump to last tool windowShift + Ctrl + T
: Test subjectCtrl + B
: Go to declarationCtrl + Alt + B
: Go to implementationAlt + F7
: Find usagesCtrl + Alt + Left / Righ
: Navigate back/forward in navigation historyCtrl + Shift + Delete
: Returns to the previous state with the unwrapping actionShift + Enter
: Open in split view
References
- https://mobile.twitter.com/GuidesJava/status/1580061764145668096
- https://www.youtube.com/watch?v=ffBeoE6NBSs
- https://www.youtube.com/watch?v=Au6NTrpTr_o
- https://www.youtube.com/watch?v=2KYk45pJ7LY
- https://www.jetbrains.com/help/idea/reference-keymap-win-default.html#basic_editing
- Learn path of IntelliJ IDEA
Comentarios
Publicar un comentario