Visual Studio Code keyboard shortcuts
VS Code's default shortcuts cover the whole coding loop: edit and navigate code, search and refactor, manage files and panels, run tasks, debug, and use the built-in chat tools. This reference follows Microsoft's current common default list for a standard US keyboard layout.
Windows, macOS, Linux · 153 shortcutsBasic editing
Change lines, add cursors, select text, move through a file, and use the everyday editor commands.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Cut the line when there is no selection | CtrlX | CmdX | CtrlX |
| Copy the line when there is no selection | CtrlC | CmdC | CtrlC |
| Paste | CtrlV | CmdV | CtrlV |
| Delete the current line | CtrlShiftK | CmdShiftK | CtrlShiftK |
| Insert a line below | CtrlEnter | CmdEnter | CtrlEnter |
| Insert a line above | CtrlShiftEnter | CmdShiftEnter | CtrlShiftEnter |
| Move the line down | AltDown | AltDown | AltDown |
| Move the line up | AltUp | AltUp | AltUp |
| Copy the line down | ShiftAltDown | ShiftOptionDown | CtrlShiftAltDown |
| Copy the line up | ShiftAltUp | ShiftOptionUp | CtrlShiftAltUp |
| Undo | CtrlZ | CmdZ | CtrlZ |
| Redo | CtrlY | CmdShiftZ | CtrlY |
| Add the selection to the next find match | CtrlD | CmdD | CtrlD |
| Move the last selection to the next find matchTwo-stroke chord. | CtrlKCtrlD | CmdKCmdD | CtrlKCtrlD |
| Undo the last cursor operation | CtrlU | CmdU | CtrlU |
| Insert a cursor at the end of each selected line | ShiftAltI | ShiftOptionI | ShiftAltI |
| Select all occurrences of the current selection | CtrlShiftL | CmdShiftL | CtrlShiftL |
| Select all occurrences of the current word | CtrlF2 | CmdF2 | CtrlF2 |
| Select the current line | CtrlL | CmdL | CtrlL |
| Insert a cursor below | CtrlAltDown | OptionCmdDown | ShiftAltDown |
| Insert a cursor above | CtrlAltUp | OptionCmdUp | ShiftAltUp |
| Jump to the matching bracket | CtrlShift\ | ShiftCmd\ | CtrlShift\ |
| Indent the line | Ctrl] | Cmd] | Ctrl] |
| Outdent the line | Ctrl[ | Cmd[ | Ctrl[ |
| Go to the beginning of the line | Home | Home | Home |
| Go to the end of the line | End | End | End |
| Go to the beginning of the file | CtrlHome | CmdUp | CtrlHome |
| Go to the end of the file | CtrlEnd | CmdDown | CtrlEnd |
| Scroll one line down | CtrlDown | CtrlPageDown | CtrlDown |
| Scroll one line up | CtrlUp | CtrlPageUp | CtrlUp |
| Scroll one page down | AltPageDown | CmdPageDown | AltPageDown |
| Scroll one page up | AltPageUp | CmdPageUp | AltPageUp |
| Select all | CtrlA | CmdA | CtrlA |
Rich language editing
Use IntelliSense, formatting, refactoring, comments, folds, and language-aware navigation when a language service is available.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Fold the current region | CtrlShift[ | OptionCmd[ | CtrlShift[ |
| Unfold the current region | CtrlShift] | OptionCmd] | CtrlShift] |
| Toggle the current foldTwo-stroke chord. | CtrlKCtrlL | CmdKCmdL | CtrlKCtrlL |
| Fold all subregionsTwo-stroke chord. | CtrlKCtrl[ | CmdKCmd[ | CtrlKCtrl[ |
| Unfold all subregionsTwo-stroke chord. | CtrlKCtrl] | CmdKCmd] | CtrlKCtrl] |
| Fold all regionsTwo-stroke chord. | CtrlKCtrl0 | CmdKCmd0 | CtrlKCtrl0 |
| Unfold all regionsTwo-stroke chord. | CtrlKCtrlJ | CmdKCmdJ | CtrlKCtrlJ |
| Add a line commentTwo-stroke chord. | CtrlKCtrlC | CmdKCmdC | CtrlKCtrlC |
| Remove a line commentTwo-stroke chord. | CtrlKCtrlU | CmdKCmdU | CtrlKCtrlU |
| Toggle a line comment | Ctrl/ | Cmd/ | Ctrl/ |
| Toggle a block comment | ShiftAltA | ShiftOptionA | CtrlShiftA |
| Trigger suggestions | CtrlSpace | CtrlSpace | CtrlSpace |
| Trigger parameter hints | CtrlShiftSpace | ShiftCmdSpace | CtrlShiftSpace |
| Format the document | ShiftAltF | ShiftOptionF | CtrlShiftI |
| Format the selectionTwo-stroke chord. | CtrlKCtrlF | CmdKCmdF | CtrlKCtrlF |
| Go to definition | F12 | F12 | F12 |
| Show hover informationTwo-stroke chord. | CtrlKCtrlI | CmdKCmdI | CtrlKCtrlI |
| Peek the definition | AltF12 | OptionF12 | CtrlShiftF10 |
| Open the definition to the sideTwo-stroke chord. | CtrlKF12 | CmdKF12 | CtrlKF12 |
| Open quick fixes | Ctrl. | Cmd. | Ctrl. |
| Go to references | ShiftF12 | ShiftF12 | ShiftF12 |
| Rename the symbol | F2 | F2 | F2 |
| Replace with the next value | CtrlShift. | ShiftCmd. | CtrlShift. |
| Replace with the previous value | CtrlShift, | ShiftCmd, | CtrlShift, |
| Expand the syntax-tree selection | ShiftAltRight | CtrlShiftCmdRight | ShiftAltRight |
| Shrink the syntax-tree selection | ShiftAltLeft | CtrlShiftCmdLeft | ShiftAltLeft |
| Trim trailing whitespaceTwo-stroke chord. | CtrlKCtrlX | CmdKCmdX | CtrlKCtrlX |
| Change the language modeTwo-stroke chord. | CtrlKM | CmdKM | CtrlKM |
Editor, window, and group management
Split editors, move groups, close and reopen tabs, and focus the part of the workspace you need.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Open a new window | CtrlShiftN | CmdShiftN | CtrlShiftN |
| Close the window | AltF4 | CmdShiftW | CtrlShiftW |
| Close the active editor | CtrlF4 | CmdW | CtrlW |
| Close the current folderTwo-stroke chord. | CtrlKF | CmdKF | CtrlKF |
| Split the editor | Ctrl\ | Cmd\ | Ctrl\ |
| Focus the first editor group | Ctrl1 | Cmd1 | Ctrl1 |
| Focus the second editor group | Ctrl2 | Cmd2 | Ctrl2 |
| Focus the third editor group | Ctrl3 | Cmd3 | Ctrl3 |
| Focus the editor group on the leftTwo-stroke chord. | CtrlKCtrlLeft | CmdKCmdLeft | CtrlKCtrlLeft |
| Focus the editor group on the rightTwo-stroke chord. | CtrlKCtrlRight | CmdKCmdRight | CtrlKCtrlRight |
| Move the editor left in its group | CtrlShiftPageUp | CmdKShiftCmdLeft | CtrlShiftPageUp |
| Move the editor right in its group | CtrlShiftPageDown | CmdKShiftCmdRight | CtrlShiftPageDown |
| Move the active editor group leftTwo-stroke chord. | CtrlKLeft | CmdKLeft | CtrlKLeft |
| Move the active editor group rightTwo-stroke chord. | CtrlKRight | CmdKRight | CtrlKRight |
| Move the editor to the next group | CtrlAltRight | CtrlCmdRight | CtrlAltRight |
| Move the editor to the previous group | CtrlAltLeft | CtrlCmdLeft | CtrlAltLeft |
Files, display, and terminal
Save and reopen work, manage tabs, change the workspace display, focus panels, and use the integrated terminal.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Create a new file | CtrlN | CmdN | CtrlN |
| Open a file | CtrlO | CmdO | CtrlO |
| Save | CtrlS | CmdS | CtrlS |
| Save allThe current Linux default list does not assign a Save All key. | CtrlKS | OptionCmdS | Not documented |
| Save as | CtrlShiftS | CmdShiftS | CtrlShiftS |
| Close all editors in the groupTwo-stroke chord. | CtrlKW | CmdKW | CtrlKW |
| Close all editorsTwo-stroke chord. | CtrlKCtrlW | CmdKCmdW | CtrlKCtrlW |
| Reopen the closed editor | CtrlShiftT | CmdShiftT | CtrlShiftT |
| Keep the active editor openTwo-stroke chord. | CtrlKEnter | CmdKEnter | CtrlKEnter |
| Copy the active file pathTwo-stroke chord. | CtrlKP | CmdKP | CtrlKP |
| Reveal the active file in the file managerTwo-stroke chord. | CtrlKR | CmdKR | CtrlKR |
| Toggle fullscreen | F11 | CtrlCmdF | F11 |
| Toggle Zen ModeTwo-stroke chord. | CtrlKZ | CmdKZ | CtrlKZ |
| Leave Zen Mode | EscEsc | EscEsc | EscEsc |
| Zoom in | Ctrl= | Cmd= | Ctrl= |
| Zoom out | Ctrl- | Cmd- | Ctrl- |
| Reset zoom | CtrlNumpad0 | CmdNumpad0 | CtrlNumpad0 |
| Toggle sidebar visibility | CtrlB | CmdB | CtrlB |
| Show Explorer and focus it | CtrlShiftE | CmdShiftE | CtrlShiftE |
| Show Search | CtrlShiftF | CmdShiftF | CtrlShiftF |
| Show Source Control | CtrlShiftG | CtrlShiftG | CtrlShiftG |
| Show Run and Debug | CtrlShiftD | CmdShiftD | CtrlShiftD |
| Show Extensions | CtrlShiftX | CmdShiftX | CtrlShiftX |
| Toggle the Output panel | CtrlShiftU | CmdShiftU | CtrlKCtrlH |
| Open Quick Open ViewThe current Linux default list does not assign this key. | CtrlQ | CtrlQ | Not documented |
| Open a new command prompt | CtrlShiftC | CmdShiftC | CtrlShiftC |
| Toggle Markdown preview | CtrlShiftV | CmdShiftV | CtrlShiftV |
| Open preview to the sideTwo-stroke chord. | CtrlKV | CmdKV | CtrlKV |
| Toggle the integrated terminal | Ctrl` | Ctrl` | Ctrl` |
Search and Search Editor
Search within files and workspaces, change search behavior, move through terms, and open results in a dedicated editor.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Find in the current file | CtrlF | CmdF | CtrlF |
| Replace in the current file | CtrlH | OptionCmdF | CtrlH |
| Replace in files | CtrlShiftH | CmdShiftH | CtrlShiftH |
| Toggle match case | AltC | OptionCmdC | AltC |
| Toggle match whole word | AltW | OptionCmdW | AltW |
| Toggle regular expression search | AltR | OptionCmdR | AltR |
| Toggle search details | CtrlShiftJ | CmdShiftJ | CtrlShiftJ |
| Focus the next search result | F4 | F4 | F4 |
| Focus the previous search result | ShiftF4 | ShiftF4 | ShiftF4 |
| Show the next search term | Down | Down | Down |
| Show the previous search term | Up | Up | Up |
| Open search results in an editor | AltEnter | CmdEnter | AltEnter |
| Focus the Search Editor input | Esc | Esc | Esc |
| Search again in the Search Editor | CtrlShiftR | CmdShiftR | CtrlShiftR |
| Delete Search Editor file results | CtrlShiftBackspace | CmdShiftBackspace | CtrlShiftBackspace |
Preferences, chat, debug, and tasks
Change VS Code's configuration, use built-in chat, start and control debugging, and run the default build task.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Open Settings | Ctrl, | Cmd, | Ctrl, |
| Open Keyboard ShortcutsTwo-stroke chord. | CtrlKCtrlS | CmdKCmdS | CtrlKCtrlS |
| Select a color themeTwo-stroke chord. | CtrlKCtrlT | CmdKCmdT | CtrlKCtrlT |
| Open Chat view | CtrlAltI | CtrlCmdI | CtrlAltI |
| Open chat in agent mode | CtrlShiftI | ShiftCmdI | CtrlShiftAltI |
| Open editor inline chat | CtrlI | CmdI | CtrlI |
| Open terminal inline chat | CtrlI | CmdI | CtrlI |
| Open quick chat | CtrlShiftAltL | ShiftOptionCmdL | CtrlShiftAltL |
| Open the chat agent picker | Ctrl. | Cmd. | Ctrl. |
| Open the language model picker | CtrlAlt. | OptionCmd. | CtrlAlt. |
| Start a new chat session | CtrlN | CmdN | CtrlN |
| Accept an inline suggestion | Tab | Tab | Tab |
| Toggle a breakpoint | F9 | F9 | F9 |
| Start debugging | F5 | F5 | F5 |
| Continue debugging | F5 | F5 | F5 |
| Run without debugging | CtrlF5 | CtrlF5 | CtrlF5 |
| Pause debugging | F6 | F6 | F6 |
| Step into | F11 | F11 | F11 |
| Run the build task | CtrlShiftB | CmdShiftB | CtrlShiftB |