VS Code Shortcuts
70+ keyboard shortcuts for Mac, Windows, and Linux. Switch OS with one click — search by action or category, then click to copy.
Showing 88 of 88 shortcuts for Mac — click any card to copy the shortcut
Essential VS Code Shortcuts for Developers
A handful of shortcuts account for the majority of productivity gains in VS Code. Cmd+P / Ctrl+P (Go to File) is arguably the most important — fuzzy-searching and opening files is far faster than navigating the explorer tree. Pair it with Cmd+Shift+O / Ctrl+Shift+O (Go to Symbol) to jump directly to a function or class within the current file, and F12 (Go to Definition) to dive into any symbol's implementation.
For editing, Shift+Alt+F / Shift+Option+F (Format Document) should become a reflex at the end of every file save. Cmd+. / Ctrl+. (Quick Fix) surfaces code actions from your language server — from importing a missing module to extracting a function — without leaving the keyboard. And F2 (Rename Symbol) safely renames across the entire workspace with full language awareness, unlike a plain find-and-replace.
Multi-cursor Editing
Multi-cursor is one of VS Code's most powerful features and one of the least used by beginners. The core workflow: Cmd+D / Ctrl+D selects the next occurrence of the word under the cursor — press it repeatedly to grow the selection, and start typing to replace every selected occurrence at once. Use Cmd+Shift+L / Ctrl+Shift+L to select all occurrences in the file instantly.
For column editing, hold Shift+Option / Shift+Alt and drag to select a rectangular block of text — perfect for editing aligned data like JSON arrays or CSS values. Combine this with Cmd+Option+Up/Down / Ctrl+Alt+Up/Down to stack cursors on adjacent lines without dragging. Press Escape to collapse all cursors back to a single cursor.
Customizing Keyboard Shortcuts
Every VS Code shortcut is fully customizable. Open the Keyboard Shortcuts editor with Cmd+K Cmd+S / Ctrl+K Ctrl+S to browse all bindings. Click the pencil icon next to any command and press your preferred key combination. Conflicts are flagged immediately, so you can resolve them before they cause issues.
For advanced customization, click the Open Keyboard Shortcuts (JSON) icon in the top-right of the shortcuts editor to edit keybindings.json directly. Each entry supports a when clause — a condition expression that controls when the binding is active (e.g., only when the editor is focused, or only in the terminal panel). This lets you reuse the same key combination for different actions depending on context.
Frequently Asked Questions
How do I customize keyboard shortcuts in VS Code?
Open the Keyboard Shortcuts editor with Cmd+K Cmd+S (Mac) or Ctrl+K Ctrl+S (Windows/Linux). Search for any command by name, click the pencil icon next to it, then press your desired key combination. You can also edit the keybindings.json file directly from the editor for more control, including when-clause conditions. Extensions like Vim or Emacs keybindings override defaults globally, so check your extension list if a shortcut is not working as expected.
What are the most important VS Code shortcuts for beginners?
Start with these five that immediately boost productivity: Cmd+P (Mac) / Ctrl+P (Windows/Linux) to jump to any file, Cmd+Shift+P / Ctrl+Shift+P for the command palette, Cmd+D / Ctrl+D to select the next occurrence of a word, F12 to go to definition, and Ctrl+` to open the terminal. Once those are muscle memory, add Format Document (Shift+Option+F / Shift+Alt+F), Quick Fix (Cmd+. / Ctrl+.), and Rename Symbol (F2) to your workflow.
How does multi-cursor editing work in VS Code?
Multi-cursor editing lets you type in multiple places simultaneously. The most common workflow: select a word, then press Cmd+D (Mac) or Ctrl+D (Windows/Linux) repeatedly to select the next occurrence, then type to replace all selections at once. For column editing, hold Shift+Option (Mac) or Shift+Alt (Windows/Linux) and drag to select a rectangle. You can also Alt+Click anywhere to place additional cursors manually. Press Escape to collapse all cursors back to one.
How do I enable Vim keybindings in VS Code?
Install the 'Vim' extension by vscodevim from the Extensions marketplace (Cmd+Shift+X / Ctrl+Shift+X). Once installed, it enables Vim normal, insert, visual, and command modes in the editor. Most Vim motions and operators work out of the box. You can configure it in settings.json under the 'vim.*' namespace — for example enabling easymotion, sneak, or remapping leader key. Note that some VS Code shortcuts may conflict with Vim's bindings and need manual resolution in keybindings.json.
What is Zen Mode and when should I use it?
Zen Mode (Cmd+K Z on Mac, Ctrl+K Z on Windows/Linux) hides the sidebar, activity bar, status bar, panel, and editor tabs — leaving only your code on screen. It's ideal when you need deep focus on a single file without visual distractions, during code reviews where full attention matters, or when presenting or screen-sharing your code. Press Escape twice or use the command palette to exit Zen Mode.