Cheatsheet VS Code / VSCodium
Editor de código da Microsoft (e VSCodium, a versão open source).
VS Code / VSCodium
file
New file
Ctrl + N
Creates a new file.
Close editor
Ctrl + W
Closes the active tab.
Open file
Ctrl + O
Opens a file.
Reopen closed editor
Ctrl + Shift + T
Reopens the last closed tab.
Save
Ctrl + S
Saves the current file.
Keyboard shortcuts
Ctrl + K, Ctrl + S
Opens the keyboard shortcuts settings.
Save the
Ctrl + Shift + S
Saves with a new name.
Edition
Undo / Redo
Ctrl + Z (undo)
Ctrl + Y (redo)
Reverts or reapplies actions.
Comment line
Ctrl + /
Comments or uncomments the line.
Select all occurrences
Ctrl + Shift + L
Selects all occurrences of the word.
Delete line
Ctrl + Shift + K
Removes the current line.
Comment block
Shift + Alt + A
Comments the selected block.
Multi-cursor
Alt + Click
Ctrl + Alt + ↑ / ↓
Adds cursors in several places.
Move line
Alt + ↑ (up)
Alt + ↓ (down)
Moves the current line.
Indent / outdent
Ctrl + ] (indent)
Ctrl + [ (outdent)
Adjusts the indentation.
Duplicate line
Shift + Alt + ↑ / ↓
Duplicates the current line.
Select occurrence
Ctrl + D
Selects the next matching word.
Navigation
Go to file
Ctrl + P
Opens a file by name.
Go to definition
F12
Jumps to the symbol definition.
Go to line
Ctrl + G
Jumps to a line number.
Peek definition
Alt + F12
Shows the definition in a pop-up window.
Go to symbol
Ctrl + Shift + O
Lists symbols in the current file.
Find references
Shift + F12
Lists where the symbol is used.
Go to symbol (workspace)
Ctrl + T
Searches symbols across the whole project.
View problems
Ctrl + Shift + M
Opens the errors and warnings panel.
Search and Replace
Search
Ctrl + F
Searches in the current file.
Replace
Ctrl + H
Replaces in the current file.
Search in files
Ctrl + Shift + F
Searches across the whole project.
Next / previous
F3 (next)
Shift + F3 (previous)
Navigates through the results.
Views and Panels
Command palette
Ctrl + Shift + P (or F1)
Opens the palette with all commands.
Source control
Ctrl + Shift + G
Opens the Git panel.
Sidebar
Ctrl + B
Shows or hides the sidebar.
Integrated terminal
Ctrl + `
Opens the integrated terminal.
Explorer
Ctrl + Shift + E
Opens the file explorer.
Split editor
Ctrl + \
Splits the editor into two panes.
Extensions
Ctrl + Shift + X
Opens the extensions manager.
Full screen
F11
Toggles full screen.
Code and Refactoring
Suggestions
Ctrl + Space
Shows autocomplete suggestions.
Format document
Shift + Alt + F
Formats the entire file.
Parameter hint
Ctrl + Shift + Space
Shows the function signature.
Format selection
Ctrl + K, Ctrl + F
Formats only the selected text.
Quick action
Ctrl + .
Shows quick fixes.
Fold / unfold code
Ctrl + Shift + [ (fold)
Ctrl + Shift + ] (unfold)
Collapses or shows code blocks.
Rename symbol
F2
Renames the symbol across the whole project.