VS Code Keyboard Shortcuts for Windows & Mac
Every default Visual Studio Code shortcut for Windows and Mac, with Linux differences: multi-cursor, search, refactoring, terminal.
VS Code keyboard shortcuts (Windows & Mac) — freetoolsforweb.com
Last verified: against the VS Code docs and default keybindings for Windows, macOS and Linux. 188 shortcuts.
- Chords: Control plus K then Control plus S means press Ctrl+K, let go, then press Ctrl+S. VS Code waits for the second key after the first.
- Linux uses the Windows keys except where a row says “Linux:”, such as Control plus Shift plus I to format a document.
- These are the defaults. Your own or an extension’s keybindings win; check them with Control plus K then Control plus S (Command plus K then Command plus S on a Mac).
Showing all 188 shortcuts in 12 categories
General and Command Palette#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Show the Command Palette (all commands) | Control plus Shift plus Por F1 | Shift plus Command plus Por F1 | |
| Quick Open: go to a file by name | Control plus P | Command plus P | |
| New window | Control plus Shift plus N | Shift plus Command plus N | |
| Close the window | Alt plus F4or Control plus Shift plus WLinux: Alt+F4 (the reference sheet also lists Ctrl+W). | Shift plus Command plus W | |
| Open Settings | Control plus comma | Command plus comma | |
| Open the Keyboard Shortcuts editor | Control plus K then Control plus S | Command plus K then Command plus S | |
| Select a color theme | Control plus K then Control plus T | Command plus K then Command plus T | |
| Open a recent folder or workspace | Control plus R | Control plus R | |
| Quick Open a view | Control plus QLinux: no default shortcut. | Control plus Q |
Basic editing#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Cut the line (no selection) | Control plus X | Command plus X | |
| Copy the line (no selection) | Control plus C | Command plus C | |
| Undo | Control plus Z | Command plus Z | |
| Redo | Control plus Y | Shift plus Command plus Z | |
| Move the line up | Alt plus Up arrow | Option plus Up arrow | |
| Move the line down | Alt plus Down arrow | Option plus Down arrow | |
| Copy (duplicate) the line up | Shift plus Alt plus Up arrowLinux: Ctrl+Shift+Alt+Up. | Option plus Shift plus Up arrow | |
| Copy (duplicate) the line down | Shift plus Alt plus Down arrowLinux: Ctrl+Shift+Alt+Down. | Option plus Shift plus Down arrow | |
| Delete the line | Control plus Shift plus K | Shift plus Command plus K | |
| Insert a line below | Control plus Enter | Command plus Enter | |
| Insert a line above | Control plus Shift plus Enter | Shift plus Command plus Enter | |
| Jump to the matching bracket | Control plus Shift plus backslash | Shift plus Command plus backslash | |
| Indent the line | Control plus right bracket | Command plus right bracket | |
| Outdent the line | Control plus left bracket | Command plus left bracket | |
| Go to the beginning of the line | Home | Home | |
| Go to the end of the line | End | End | |
| Go to the beginning of the file | Control plus Home | Command plus Up arrow | |
| Go to the end of the file | Control plus End | Command plus Down arrow | |
| Scroll up one line | Control plus Up arrow | Control plus Page Up | |
| Scroll down one line | Control plus Down arrow | Control plus Page Down | |
| Scroll up one page | Alt plus Page Up | Command plus Page Up | |
| Scroll down one page | Alt plus Page Down | Command plus Page Down | |
| Toggle line comment | Control plus slash | Command plus slash | |
| Add line comment | Control plus K then Control plus C | Command plus K then Command plus C | |
| Remove line comment | Control plus K then Control plus U | Command plus K then Command plus U | |
| Toggle block comment | Shift plus Alt plus ALinux: Ctrl+Shift+A. | Option plus Shift plus A | |
| Toggle word wrap | Alt plus Z | Option plus Z | |
| Fold (collapse) the region | Control plus Shift plus left bracket | Option plus Command plus left bracket | |
| Unfold (expand) the region | Control plus Shift plus right bracket | Option plus Command plus right bracket | |
| Toggle fold at the cursor | Control plus K then Control plus L | Command plus K then Command plus L | |
| Fold all subregions | Control plus K then Control plus left bracket | Command plus K then Command plus left bracket | |
| Unfold all subregions | Control plus K then Control plus right bracket | Command plus K then Command plus right bracket | |
| Fold all regions | Control plus K then Control plus 0 | Command plus K then Command plus 0 | |
| Unfold all regions | Control plus K then Control plus J | Command plus K then Command plus J | |
| Fold all block comments | Control plus K then Control plus slash | Command plus K then Command plus slash | |
| Toggle overtype / insert mode | Insert | Option plus Command plus O |
Multi-cursor and selection#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Add a cursor where you click | Alt plus clickOn some Linux distributions Alt+Click is taken by the window manager; switch the modifier with the editor.multiCursorModifier setting. | Option plus click | |
| Add a cursor above | Control plus Alt plus Up arrowLinux: Shift+Alt+Up. | Option plus Command plus Up arrow | |
| Add a cursor below | Control plus Alt plus Down arrowLinux: Shift+Alt+Down. | Option plus Command plus Down arrow | |
| Undo the last cursor operation | Control plus U | Command plus U | |
| Add cursors at the end of each selected line | Shift plus Alt plus I | Option plus Shift plus I | |
| Select the current line | Control plus L | Command plus L | |
| Select the word, then add the next match | Control plus D | Command plus D | |
| Move the last selection to the next match (skip) | Control plus K then Control plus D | Command plus K then Command plus D | |
| Select all occurrences of the selection | Control plus Shift plus L | Shift plus Command plus L | |
| Select all occurrences of the current word | Control plus F2 | Command plus F2 | |
| Expand the selection (smart select) | Shift plus Alt plus Right arrow | Control plus Shift plus Command plus Right arrow | |
| Shrink the selection | Shift plus Alt plus Left arrow | Control plus Shift plus Command plus Left arrow | |
| Column (box) selection with the mouse | Shift plus Alt plus drag | Option plus Shift plus drag | |
| Column (box) selection with the keyboard | Control plus Shift plus Alt plus arrow keys | Option plus Shift plus Command plus arrow keys | |
| Column (box) selection a page up or down | Control plus Shift plus Alt plus Page Upor Control plus Shift plus Alt plus Page Down | Option plus Shift plus Command plus Page Upor Option plus Shift plus Command plus Page Down |
Search and replace#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Find in the file | Control plus F | Command plus F | |
| Replace in the file | Control plus H | Option plus Command plus F | |
| Find next | Enteror F3 | Enteror Command plus G | |
| Find previous | Shift plus Enteror Shift plus F3 | Shift plus Enteror Shift plus Command plus G | |
| Select all matches of the Find term | Alt plus Enter | Option plus Enter | |
| Toggle match case | Alt plus C | Option plus Command plus C | |
| Toggle regular expressions | Alt plus R | Option plus Command plus R | |
| Toggle match whole word | Alt plus W | Option plus Command plus W | |
| Toggle find in selection | Alt plus L | Option plus Command plus L | |
| Search across files (Search view) | Control plus Shift plus F | Shift plus Command plus F | |
| Replace in files | Control plus Shift plus H | Shift plus Command plus H | |
| Toggle search details (include/exclude) | Control plus Shift plus J | Shift plus Command plus J | |
| Focus the next search result | F4 | F4 | |
| Focus the previous search result | Shift plus F4 | Shift plus F4 |
Rich language editing (IntelliSense, refactoring)#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Trigger suggestions (IntelliSense) | Control plus Space bar | Control plus Space bar | |
| Trigger parameter hints | Control plus Shift plus Space bar | Shift plus Command plus Space bar | |
| Format the document | Shift plus Alt plus FLinux: Ctrl+Shift+I. | Option plus Shift plus F | |
| Format the selection | Control plus K then Control plus F | Command plus K then Command plus F | |
| Go to definition | F12 | F12 | |
| Peek definition | Alt plus F12Linux: Ctrl+Shift+F10. | Option plus F12 | |
| Open definition to the side | Control plus K then F12 | Command plus K then F12 | |
| Quick Fix (code actions) | Control plus period | Command plus period | |
| Go to references | Shift plus F12 | Shift plus F12 | |
| Show all references in the References view | Shift plus Alt plus F12 | Option plus Shift plus F12 | |
| Rename symbol | F2 | F2 | |
| Show hover information | Control plus K then Control plus I | Command plus K then Command plus I | |
| Replace with the next value | Control plus Shift plus period | Shift plus Command plus period | |
| Replace with the previous value | Control plus Shift plus comma | Shift plus Command plus comma | |
| Trim trailing whitespace | Control plus K then Control plus X | Command plus K then Command plus X | |
| Change the file’s language mode | Control plus K then M | Command plus K then M |
Editor and window management#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Close the editor (tab) | Control plus F4or Control plus WLinux: Ctrl+W. | Command plus W | |
| Close all editors in the group | Control plus K then W | Command plus K then W | |
| Close all editors | Control plus K then Control plus W | Command plus K then Command plus W | |
| Close the folder | Control plus K then F | Command plus K then F | |
| Split the editor | Control plus backslash | Command plus backslash | |
| Split the editor inside its group | Control plus K then Control plus Shift plus backslash | Command plus K then Shift plus Command plus backslash | |
| Focus the 1st, 2nd or 3rd editor group | Control plus 1 to 3 | Command plus 1 to 3 | |
| Focus the editor group on the left | Control plus K then Control plus Left arrow | Command plus K then Command plus Left arrow | |
| Focus the editor group on the right | Control plus K then Control plus Right arrow | Command plus K then Command plus Right arrow | |
| Open the editor (tab) to the right | Control plus Page Down | Option plus Command plus Right arrow | |
| Open the editor (tab) to the left | Control plus Page Up | Option plus Command plus Left arrow | |
| Move the editor (tab) left | Control plus Shift plus Page Up | Command plus K then Shift plus Command plus Left arrow | |
| Move the editor (tab) right | Control plus Shift plus Page Down | Command plus K then Shift plus Command plus Right arrow | |
| Move the active editor group left | Control plus K then Left arrow | Command plus K then Left arrow | |
| Move the active editor group right | Control plus K then Right arrow | Command plus K then Right arrow | |
| Move the editor into the next group | Control plus Alt plus Right arrow | Control plus Command plus Right arrow | |
| Move the editor into the previous group | Control plus Alt plus Left arrow | Control plus Command plus Left arrow | |
| Keep a preview editor open | Control plus K then Enter | Command plus K then Enter | |
| Pin the editor tab | Control plus K then Shift plus Enter | Command plus K then Shift plus Enter | |
| Toggle maximize editor group | Control plus K then Control plus M | Command plus K then Command plus M | |
| Toggle vertical/horizontal editor layout | Shift plus Alt plus 0 | Option plus Command plus 0 | |
| Copy the editor into a new window | Control plus K then O | Command plus K then O |
File management#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| New file | Control plus N | Command plus N | |
| Open file | Control plus O | Command plus O | |
| Save | Control plus S | Command plus S | |
| Save As | Control plus Shift plus S | Shift plus Command plus S | |
| Save all | Control plus K then SLinux: no default shortcut. | Option plus Command plus S | |
| Reopen the last closed editor | Control plus Shift plus T | Shift plus Command plus T | |
| Copy the path of the active file | Control plus K then P | Command plus K then P | |
| Reveal the active file in Explorer / Finder | Control plus K then R | Command plus K then R | |
| Compare the active file with the clipboard | Control plus K then C | Command plus K then C | |
| Compare the active file with the saved version | Control plus K then D | Command plus K then D | |
| Open the file to the side (from Quick Open or Explorer) | Control plus Enter | Control plus Enter | |
| Find a file in the Explorer treeWith focus in the Explorer. | Control plus Alt plus F | Option plus Command plus F |
Display, views and panels#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Toggle the Primary Side Bar | Control plus B | Command plus B | |
| Toggle the Secondary Side Bar | Control plus Alt plus B | Option plus Command plus B | |
| Toggle the panel (terminal, output, problems) | Control plus J | Command plus J | |
| Show the Explorer | Control plus Shift plus E | Shift plus Command plus E | |
| Show Source Control (Git) | Control plus Shift plus G | Control plus Shift plus G | |
| Show Run and Debug | Control plus Shift plus D | Shift plus Command plus D | |
| Show Extensions | Control plus Shift plus X | Shift plus Command plus X | |
| Show the Output panel | Control plus Shift plus ULinux: Ctrl+K Ctrl+H. | Shift plus Command plus U | |
| Toggle full screen | F11 | Control plus Command plus F | |
| Toggle Zen Mode (press Esc twice to leave) | Control plus K then Z | Command plus K then Z | |
| Zoom in | Control plus equals | Command plus equals | |
| Zoom out | Control plus hyphen | Command plus hyphen | |
| Reset zoom | Control plus zero on the numeric keypad | Command plus zero on the numeric keypad | |
| Toggle Markdown preview | Control plus Shift plus V | Shift plus Command plus V | |
| Open Markdown preview to the side | Control plus K then V | Command plus K then V |
Debug and tasks#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Toggle breakpoint | F9 | F9 | |
| Start or continue debugging | F5 | F5 | |
| Run without debugging | Control plus F5 | Control plus F5 | |
| Stop debugging | Shift plus F5 | Shift plus F5 | |
| Pause | F6 | F6 | |
| Step over | F10 | F10 | |
| Step into | F11 | F11 | |
| Step out | Shift plus F11 | Shift plus F11 | |
| Run the build task | Control plus Shift plus B | Shift plus Command plus B |
Integrated terminal#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Show or hide the integrated terminal | Control plus grave accent | Control plus grave accent | |
| Create a new terminal | Control plus Shift plus grave accent | Control plus Shift plus grave accent | |
| Split the terminalWith the terminal focused. | Control plus Shift plus 5 | Command plus backslash | |
| Copy the selection in the terminal | Control plus CLinux: Ctrl+Shift+C. | Command plus C | |
| Paste into the terminal | Control plus VLinux: Ctrl+Shift+V. | No default shortcut | |
| Find in the terminalWith the terminal focused. | Control plus F | Command plus F | |
| Scroll to the previous command | Control plus Up arrow | Command plus Up arrow | |
| Scroll to the next command | Control plus Down arrow | Command plus Down arrow | |
| Scroll the terminal up a page | Shift plus Page Up | Page Up | |
| Scroll the terminal down a page | Shift plus Page Down | Page Down | |
| Scroll to the top of the terminal | Control plus HomeLinux: Shift+Home. | Command plus Home | |
| Scroll to the bottom of the terminal | Control plus EndLinux: Shift+End. | Command plus End | |
| Focus the next terminal in a split group | Alt plus Right arrow | Option plus Command plus Right arrow | |
| Focus the previous terminal in a split group | Alt plus Left arrow | Option plus Command plus Left arrow | |
| Focus the next terminal group | Control plus Page Down | Shift plus Command plus right bracket | |
| Focus the previous terminal group | Control plus Page Up | Shift plus Command plus left bracket | |
| Open a detected link in the terminalWith the terminal focused. | Control plus Shift plus G | Shift plus Command plus G | |
| Open an external terminal | Control plus Shift plus C | Shift plus Command plus C |
Chat and AI#
| Action | Windows | Mac | Copy |
|---|---|---|---|
| Open the Chat view | Control plus Alt plus I | Control plus Command plus I | |
| Open chat in agent mode | Control plus Shift plus ILinux: Ctrl+Shift+Alt+I. | Shift plus Command plus I | |
| Inline chat in the editor or terminal | Control plus I | Command plus I | |
| Open quick chat | Control plus Shift plus Alt plus L | Option plus Shift plus Command plus L | |
| Open the language model pickerIn the Chat view. | Control plus Alt plus period | Option plus Command plus period | |
| Open the agent pickerIn the Chat view. | Control plus period | Command plus period | |
| Start a new chat sessionIn the Chat view. | Control plus N | Command plus N | |
| Accept an inline (ghost text) suggestion | Tab | Tab |
Sources (7 official pages)
Everything runs in your browser; searches are not sent anywhere. Shortcuts are checked against the official VS Code documentation. Browse all free tools.
Found a problem, or something that could be better? We read every message and we fix things quickly.
This VS Code shortcuts cheat sheet lists the default keyboard shortcuts of Visual Studio Code for Windows and Mac in one table, with the Linux keys noted wherever they differ. It covers the shortcuts that change how fast you edit, such as Ctrl+D to add the next match to a multi-cursor selection, Alt+Up and Down to move lines, F2 to rename a symbol everywhere and Ctrl+Shift+P for the Command Palette, plus the chords (Ctrl+K, then another key) that are hard to discover on your own.
Everything was checked on 2026-10-18 against code.visualstudio.com: the official keyboard shortcut reference sheets for Windows, macOS and Linux and the current documentation, which wins where the two disagree. These are defaults for a US keyboard layout. Extensions, keymaps (Vim, IntelliJ, Sublime) and your own keybindings.json override them, so if a shortcut does something else on your machine, check the Keyboard Shortcuts editor with Ctrl+K Ctrl+S.
How to use
- Pick a category chip (Multi-cursor, Search, Terminal...) or scroll the full list.
- Search by action ("duplicate line") or by keys ("shift alt down").
- For chords like Ctrl+K then Ctrl+S, press the first pair, release, then press the second.
- On Linux, use the Windows column unless the row has a "Linux:" note.
- Copy a shortcut, link to a row, or print the sheet as a PDF.
Frequently asked questions
How do I open the Command Palette in VS Code?
Press Ctrl+Shift+P on Windows and Linux or Cmd+Shift+P on a Mac. F1 works on all three. The Command Palette lists every command with its current shortcut, so it is also the quickest way to look one up. Ctrl+P (Cmd+P) opens Quick Open for files instead.
How do I use multiple cursors in VS Code?
Alt+Click (Option+Click on Mac) adds a cursor where you click. Ctrl+Alt+Up or Down (Cmd+Option+Up/Down on Mac, Shift+Alt+Up/Down on Linux) adds one on the line above or below. Ctrl+D (Cmd+D) selects the word and then each next occurrence, and Ctrl+Shift+L (Cmd+Shift+L) selects all occurrences at once. Ctrl+U undoes the last cursor you added.
What is the shortcut to format code in VS Code?
Shift+Alt+F on Windows, Shift+Option+F on a Mac and Ctrl+Shift+I on Linux formats the whole document with the formatter set for that language. To format only the selection, press Ctrl+K then Ctrl+F (Cmd+K then Cmd+F).
How do I comment out lines in VS Code?
Ctrl+/ (Cmd+/ on Mac) toggles a line comment on the current line or every selected line. Shift+Alt+A (Shift+Option+A on Mac, Ctrl+Shift+A on Linux) toggles a block comment around the selection.
How do I duplicate a line in VS Code?
Shift+Alt+Down copies the line below and Shift+Alt+Up above on Windows; on a Mac use Shift+Option+Down or Up, and on Linux Ctrl+Shift+Alt+Down or Up. Without Shift, Alt+Up and Alt+Down move the line instead of copying it.
How do I change or reset a keyboard shortcut in VS Code?
Open the Keyboard Shortcuts editor with Ctrl+K then Ctrl+S (Cmd+K then Cmd+S), search for the command, double-click it and press the new keys. To edit the JSON file directly, select the Open Keyboard Shortcuts (JSON) button at the top right of that editor. Right-click an entry for Remove Keybinding or Show Same Keybindings, which reveals conflicts.
The VS Code shortcuts that save the most time
Shortcuts for opening menus save seconds; these save minutes because they replace whole manual edits (Windows keys first, Mac in brackets):
• Ctrl+D (Cmd+D): select the next occurrence of the word for a quick multi-cursor rename
• Alt+Up / Down (Option+Up / Down): move the line; add Shift to copy it
• Ctrl+Shift+K (Cmd+Shift+K): delete the line without selecting it
• F2: rename a symbol across the project, not just in the file
• F12 and Alt+F12 (Option+F12): go to or peek at a definition; Alt+Left (Ctrl+- on Mac) jumps back
• Ctrl+. (Cmd+.): Quick Fix, for missing imports and lint fixes
• Ctrl+P (Cmd+P) and Ctrl+Shift+O (Cmd+Shift+O): open a file, then jump to a symbol in it
• Ctrl+G (Ctrl+G on Mac too): go to a line number from an error message
• Ctrl+` (Ctrl+` on Mac too): toggle the terminal; Ctrl+J (Cmd+J) toggles the whole panel
Chords: why some shortcuts need two steps
VS Code runs out of single combinations, so many commands start with Ctrl+K (Cmd+K on Mac) and wait for a second key. Press Ctrl+K, let go, then press the second part; VS Code waits for it. Ctrl+K Ctrl+S opens the Keyboard Shortcuts editor, Ctrl+K Ctrl+T the theme picker, Ctrl+K Z Zen Mode, Ctrl+K V a Markdown preview to the side and Ctrl+K Ctrl+0 folds everything.
Watch whether the second key needs Ctrl as well. Ctrl+K M (no Ctrl on the M) changes the file's language mode, while Ctrl+K Ctrl+M maximizes the editor group. This sheet writes each step out in full.
Linux and other keyboard layouts
On Linux VS Code mostly uses the Windows keys, with a few changes where the desktop environment already owns a combination. The ones to know:
• Format document: Ctrl+Shift+I instead of Shift+Alt+F
• Add cursor above/below: Shift+Alt+Up/Down instead of Ctrl+Alt+Up/Down
• Copy line up/down: Ctrl+Shift+Alt+Up/Down
• Block comment: Ctrl+Shift+A; Peek Definition: Ctrl+Shift+F10
• Go back / forward: Ctrl+Alt+- and Ctrl+Shift+-
• Terminal copy and paste: Ctrl+Shift+C and Ctrl+Shift+V
VS Code's own documents render shortcuts for a US layout. On other layouts, keys such as [, ] and / can sit elsewhere; the Keyboard Shortcuts editor shows the keys for your actual layout.
Related free tools
- JSON Formatter — Pretty-print, minify and validate JSON, with parse errors located by line and column. In your browser, no upload.
- Regex Tester — Test a regular expression against sample text with live match highlighting, capture groups and replace preview. Free, in your browser.
- Claude Code Cheat Sheet — Claude Code slash commands, CLI flags, keyboard shortcuts, CLAUDE.md and settings locations, hooks and MCP commands on one page.
- Windows Keyboard Shortcuts — Every Windows 11 shortcut in one searchable, printable list: Win key, Snap, desktops, screenshots, File Explorer.
- Mac Keyboard Shortcuts — Every macOS shortcut with ⌘ ⌥ ⌃ ⇧ symbols explained: screenshots, window tiling, Finder, Safari and special characters.