Learning a handful of VS Code keyboard shortcuts is one of the fastest ways to speed up your editing. This cheat sheet groups the most useful shortcuts by task — the command palette, editing, multi-cursor selection, navigation, search, and managing files.
Shortcuts are shown for Windows and Linux, with the macOS equivalent noted where it differs (usually Ctrl becomes Cmd). You can always view and remap every shortcut with Ctrl+K Ctrl+S.
General
| Shortcut (Win/Linux) | What it does |
|---|
Ctrl+Shift+P | Open the Command Palette — run any command by name (macOS: Cmd+Shift+P). |
Ctrl+P | Quick Open — jump to any file by name (macOS: Cmd+P). |
Ctrl+, | Open Settings (macOS: Cmd+,). |
Ctrl+K Ctrl+S | Open the Keyboard Shortcuts editor. |
Ctrl+B | Toggle the sidebar (macOS: Cmd+B). |
Ctrl+` | Toggle the integrated terminal. |
Editing
| Shortcut (Win/Linux) | What it does |
|---|
Ctrl+X / Ctrl+C | Cut / copy the current line when nothing is selected. |
Alt+Up / Alt+Down | Move the current line up or down (macOS: Option+Up/Down). |
Shift+Alt+Up / Down | Copy the current line up or down. |
Ctrl+/ | Toggle a line comment (macOS: Cmd+/). |
Shift+Alt+A | Toggle a block comment. |
Ctrl+] | Indent the current line (macOS: Cmd+]). |
Ctrl+Shift+K | Delete the current line. |
Multi-cursor & Selection
| Shortcut (Win/Linux) | What it does |
|---|
Alt+Click | Add another cursor where you click (macOS: Option+Click). |
Ctrl+D | Select the next occurrence of the current word (macOS: Cmd+D). |
Ctrl+Shift+L | Select all occurrences of the current word. |
Ctrl+Alt+Up / Down | Add a cursor on the line above or below. |
Ctrl+L | Select the current line. |
Navigation
| Shortcut (Win/Linux) | What it does |
|---|
Ctrl+G | Go to a specific line number. |
Ctrl+Shift+O | Go to a symbol in the current file. |
Ctrl+T | Go to a symbol across the whole workspace. |
F12 | Go to the definition of a symbol. |
Alt+Left / Alt+Right | Navigate back / forward through cursor history. |
Ctrl+Tab | Switch between open editors. |
Search & Replace
| Shortcut (Win/Linux) | What it does |
|---|
Ctrl+F | Find in the current file (macOS: Cmd+F). |
Ctrl+H | Replace in the current file. |
Ctrl+Shift+F | Search across all files in the project. |
Ctrl+Shift+H | Replace across all files. |
Files & Windows
| Shortcut (Win/Linux) | What it does |
|---|
Ctrl+N | Open a new untitled file. |
Ctrl+S | Save the current file (macOS: Cmd+S). |
Ctrl+W | Close the current editor. |
Ctrl+\ | Split the editor into two panes. |
Ctrl+K Z | Toggle Zen (distraction-free) mode. |
VS Code Keyboard Shortcuts Cheat Sheet FAQs
What is the most important VS Code shortcut to learn first?
The Command Palette, Ctrl+Shift+P (Cmd+Shift+P on macOS). It lets you run any command by typing its name, so you can do almost anything without memorizing every other shortcut.
How do I add multiple cursors in VS Code?
Hold Alt (Option on macOS) and click to place extra cursors, or press Ctrl+Alt+Up/Down to add a cursor on the line above or below. Use Ctrl+D to add a cursor at the next occurrence of the current word.
How do I open a file quickly in VS Code?
Press Ctrl+P (Cmd+P on macOS) to open Quick Open, then start typing the file name. You can also type @ to jump to a symbol or : to go to a line.
How do I comment out code in VS Code?
Press Ctrl+/ (Cmd+/ on macOS) to toggle a line comment on the current line or selection. Use Shift+Alt+A to toggle a block comment.
How do I search across all files in the project?
Press Ctrl+Shift+F to open the search panel and search every file in the workspace. Use Ctrl+Shift+H to search and replace across all files.
How do I move a line up or down?
Press Alt+Up or Alt+Down (Option on macOS) to move the current line. Add Shift (Shift+Alt+Up/Down) to copy the line instead of moving it.
Can I customize VS Code keyboard shortcuts?
Yes. Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S, search for any command, and assign your own key binding. You can also edit keybindings.json directly for advanced rules.