VS Code Shortcuts
Essential Visual Studio Code keyboard shortcuts for Windows/Linux and macOS, the command palette, editing, multi-cursor selection, navigation, and search and refactor.
The Visual Studio Code shortcuts worth committing to memory, with Windows/Linux and macOS keys side by side. If you only learn one, make it the Command Palette (Ctrl/Cmd+Shift+P), it can run every command and shows the shortcut next to each.
Command & files
| Action | Windows / Linux | Mac |
|---|---|---|
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Quick Open file | Ctrl+P | Cmd+P |
| New / close file | Ctrl+N / Ctrl+W | Cmd+N / Cmd+W |
| Save / Save all | Ctrl+S / Ctrl+K S | Cmd+S / Cmd+Option+S |
| Reopen closed editor | Ctrl+Shift+T | Cmd+Shift+T |
| Toggle sidebar | Ctrl+B | Cmd+B |
| Toggle terminal | Ctrl+` | Ctrl+` |
Editing
| Action | Windows / Linux | Mac |
|---|---|---|
| Copy / cut line (no selection) | Ctrl+C / Ctrl+X | Cmd+C / Cmd+X |
| Move line up / down | Alt+Up / Alt+Down | Option+Up / Option+Down |
| Copy line up / down | Shift+Alt+Up / Down | Shift+Option+Up / Down |
| Delete line | Ctrl+Shift+K | Cmd+Shift+K |
| Insert line below / above | Ctrl+Enter / Ctrl+Shift+Enter | Cmd+Enter / Cmd+Shift+Enter |
| Toggle line comment | Ctrl+/ | Cmd+/ |
| Indent / outdent | Ctrl+] / Ctrl+[ | Cmd+] / Cmd+[ |
Multi-cursor & selection
| Action | Windows / Linux | Mac |
|---|---|---|
| Add cursor | Alt+Click | Option+Click |
| Add cursor above / below | Ctrl+Alt+Up / Down | Cmd+Option+Up / Down |
| Select next match | Ctrl+D | Cmd+D |
| Select all matches | Ctrl+Shift+L | Cmd+Shift+L |
| Expand / shrink selection | Shift+Alt+Right / Left | Ctrl+Shift+Right / Left |
| Select current line | Ctrl+L | Cmd+L |
Navigation
| Action | Windows / Linux | Mac |
|---|---|---|
| Go to line | Ctrl+G | Ctrl+G |
| Go to symbol | Ctrl+Shift+O | Cmd+Shift+O |
| Go to definition | F12 | F12 |
| Peek definition | Alt+F12 | Option+F12 |
| Go back / forward | Alt+Left / Alt+Right | Ctrl+Minus / Ctrl+Shift+Minus |
| Switch editor tab | Ctrl+Tab | Cmd+Tab in window |
Search & refactor
| Action | Windows / Linux | Mac |
|---|---|---|
| Find / Replace | Ctrl+F / Ctrl+H | Cmd+F / Cmd+Option+F |
| Search across files | Ctrl+Shift+F | Cmd+Shift+F |
| Rename symbol | F2 | F2 |
| Format document | Shift+Alt+F | Shift+Option+F |
| Quick fix | Ctrl+. | Cmd+. |
| Trigger suggestions | Ctrl+Space | Ctrl+Space |
Some shortcuts are chords, press the first combo, release, then press the next (for example Ctrl+K then S). Open Preferences: Keyboard Shortcuts from the Command Palette to search and rebind any of these to your liking.
What this does
A VS Code shortcuts reference lists essential keyboard shortcuts for Windows/Linux and macOS — the command palette, editing, multi-cursor, navigation, and search.
How to use it
- Browse by task.
- Find the keys for your OS.
- Copy the shortcut with one tap.
- Try it in the editor.
Example
Ctrl/Cmd+Shift+P opens the Command Palette.
Sources & methodology
Last updated .
Frequently asked questions
What is the single most useful shortcut?
The Command Palette (Ctrl/Cmd+Shift+P). It can run any command and shows the keyboard shortcut next to each one, so you learn the rest as you go.
How do I edit multiple lines at once?
Add cursors with Alt/Option+Click, or select the next occurrence of the current word with Ctrl/Cmd+D and type to change them all together.
Can I change these shortcuts?
Yes. Open "Preferences: Keyboard Shortcuts" from the Command Palette to search, view, and rebind any shortcut.
Related tools
Excel Shortcuts
The most useful Microsoft Excel keyboard shortcuts, with Windows and Mac keys side by side, essentials, navigation and selection, editing, formulas, and formatting.
Photoshop Shortcuts
Time-saving Adobe Photoshop keyboard shortcuts, with Windows and Mac keys, file and history, view and zoom, single-key tool selection, layers, and selections and editing.
macOS Keyboard Shortcuts
The most useful macOS keyboard shortcuts, essentials, Finder and files, window and app switching, screenshots, text editing, and system, with the modifier-key symbols explained.
Windows Keyboard Shortcuts
The most useful Windows keyboard shortcuts, essentials, the Win key, window snapping and virtual desktops, screenshots, File Explorer, and system task management.