JetBrains
Searching and Finding
  • Shift pressed twice Composite search, can search for file name, class name, variables, methods, etc.
  • Ctrl + Shift + N Locate / Open files or directories by file name. Add a forward-slash to the end of the input to open a directory.
  • Ctrl + Shift + F Search for files containing specified content across entire project or specific directories.
  • Ctrl + Shift + R Replace specified content across entire project or specific directories.
  • Ctrl + F Find text in current file.
  • Ctrl + R Replace text in current file.
  • Ctrl + N Find class file based on the input class name.
  • Ctrl + F12 Display structure of current file. Can filter using input on pop-up layer.
Current File
  • Ctrl + Z Undo.
  • Ctrl + Shift + Z Redo.
  • Ctrl + Y Delete current line or selected lines.
  • Ctrl + D Copy the current line or selected text and insert it below the current line.
  • Ctrl + / Comment out the current line.
  • Ctrl + Shift + / Comment out the selected code block.
  • Alt + Insert Auto-generate code, such as setObject/getObject methods, constructors, toString(), etc.
  • Ctrl + J Insert code template.
  • Ctrl + F4 Close current editing file.
  • Ctrl + Tab Switch between editing windows. Pressing delete during the switching process closes the selected window.
  • Ctrl + Alt + L Format code.
  • Ctrl + Alt + O Optimize imports by deleting unused imports.
  • Ctrl + Shift + F12 Maximize the editor.
  • Shift + F6 Rename file/folder.
  • Ctrl + Alt + Left Arrow Return to previous editing location.
  • Ctrl + Alt + Right Arrow Go back to previous editing location.
Informational Prompts
  • Ctrl + E Display list of recently opened files.
  • Ctrl + P Display documentation for parameters.
  • Ctrl + Q Display documentation for the variable/class/method above the cursor (can also be done during auto-suggestion).
  • Alt + Enter Offer quick fix based on the problem at the cursor position.
Jump
  • Ctrl + G Go to line in current file
  • Ctrl + U Go to definition of method or interface in parent class
  • Ctrl + B Go to implementation of method/variable or interface definition under cursor
  • Ctrl + Left Click Same as Ctrl + B
  • F2 Go to the next highlighted error or warning location
  • Ctrl + Alt + F7 Show usage
Version Control
  • Ctrl + K Commit changes
  • Ctrl + T Update project
  • Alt + ` Show version control popup menu
Others
  • Ctrl + Alt + S Open system settings
  • Ctrl + Shift + C Copy current file path to clipboard
  • Shift + F9 Debug current project
  • Shift + F10 Run current project
Visual Studio Code
global
  • F11 toggle full screen
  • Ctrl + Shift + P , F1 Show command panel
  • Ctrl + P Jump to file
  • Ctrl + B Toggle sidebar visibility
  • Ctrl + Shift + E Show Resource Control
  • Ctrl + Shift + G Show git control
  • Ctrl + Shift + D Show debugging
  • Ctrl + Shift + X Show extensions
  • Ctrl + Shift + U Show output panel
  • Ctrl + Shift + V Open markdown preview
  • Shift + F11 Open zen mode
  • Ctrl + ` Open terminal
  • Ctrl + Shift + ` Add new terminal
  • Ctrl + Shift + N Create new window
  • Ctrl + Shift + W Close window
  • Ctrl + K Ctrl + S Show keyboard shortcuts
  • Ctrl + \ Split compiler
  • Ctrl + 1/2/3 Focus on first, second, third compiler
Search and Replace
  • Ctrl + F Current file search
  • Ctrl + H Current file search replace
  • Ctrl + Shift + F Search within folder
  • Ctrl + Shift + H In-folder search and replace
Current file
  • Ctrl + Shift + [ Collapse area
  • Ctrl + Shift + ] Expand area
  • Ctrl + / Toggle line comments
  • Shift + Alt + A Toggle block comments
  • Ctrl + G Go to line
  • Shift + Alt + F Format file
  • Ctrl + K Ctrl + F Format selection
  • F12, Ctrl + Left mouse button Go to definition
  • Ctrl + S Save
  • Ctrl + Shift + S Save as
Info Tip
  • Ctrl + Shift + M Show problem panel
  • Ctrl + Shift + Tab Show browsing history
  • Ctrl + Space Trigger suggestions
  • Ctrl + Shift + Space Triggers parameter hints
Debug
  • F9 Breakpoint
  • F5 Start/continue debugging
  • Shift + F5 Stop
  • Shift+F11 Step
  • F10 Step through
Vim
cursor position insertion
  • i insert at cursor position
  • :n position the cursor on line n
  • Shift + H positions the cursor to the first character of the first line
  • Shift + L Position the cursor to the first character of the last line
undo
  • u Undoes the last edit
  • Shift + U Undoes the entire line of the current cursor
  • Ctrl + r Restore the initial file state
  • e! Undoes all changes and restores the file to the state it was in when it was opened
Delete
  • dd Delete the current line
  • :1,$d Delete all lines
copy/paste
  • yy Copy the current line
  • p Paste the last copy at the current cursor
  • :/text search for text from top down, press n to search down, press N to search forward
  • :?text Find text from bottom to top, press n to search down, press N to search forward
Replace
  • :s/old/new Find the first occurrence of old and replace it with new
  • :s/old/new/g Find all occurrences of old and replace them with new (current screen)
  • :%s/old/new/g Replace all olds in the entire file
  • :%s/old/new/gc Replace all olds in the entire file, but ask if they are replaced at each occurrence
  • :n,ms/old/new/g Replaces all olds between line numbers n and m
Exit

Press ESC first and then operate the shortcut keys that follow.

  • :w Write but do not exit
  • :w! Force save but don’t exit
  • :q! Exit but not save
  • :wq Save write and exit
  • :w file Save the current file contents to a file
  • :qa! Quit all files without saving, e.g., if multiple files are open
set
  • :set ignorecase Ignore case lookup
  • :set noignorecase Do not ignore case lookups
  • :set hlsearch Highlight search results
  • :set nohlsearch Turn off highlighting of search results
  • :set number Show line numbers
  • :set nonumber Don’t show line numbers