VS Code keyboard shortcuts
Visual Studio Code is Microsoft's free code editor, which you extend for the languages you write. Its default keys here cover multi-cursor editing, jumping to files and symbols, workspace search, split editors, the terminal, and the debugger.
Windows, macOS, Linux · 153 shortcutsBasic editing
Change lines, add cursors, select text, move through a file, and use the everyday editor commands.
| Action | Shortcuts |
|---|---|
| Cut the line when there is no selection | Windows / LinuxCtrl + X macOSCmd + X |
| Copy the line when there is no selection | Windows / LinuxCtrl + C macOSCmd + C |
| Paste | Windows / LinuxCtrl + V macOSCmd + V |
| Delete the current line | Windows / LinuxCtrl + Shift + K macOSCmd + Shift + K |
| Insert a line below | Windows / LinuxCtrl + Enter macOSCmd + Enter |
| Insert a line above | Windows / LinuxCtrl + Shift + Enter macOSCmd + Shift + Enter |
| Move the line down | Windows / macOS / LinuxAlt + Down |
| Move the line up | Windows / macOS / LinuxAlt + Up |
| Copy the line down | WindowsShift + Alt + Down macOSShift + Option + Down LinuxCtrl + Shift + Alt + Down |
| Copy the line up | WindowsShift + Alt + Up macOSShift + Option + Up LinuxCtrl + Shift + Alt + Up |
| Undo | Windows / LinuxCtrl + Z macOSCmd + Z |
| Redo | Windows / LinuxCtrl + Y macOSCmd + Shift + Z |
| Add the selection to the next find match | Windows / LinuxCtrl + D macOSCmd + D |
| Move the last selection to the next find matchTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + D macOSCmd + K then Cmd + D |
| Undo the last cursor operation | Windows / LinuxCtrl + U macOSCmd + U |
| Insert a cursor at the end of each selected line | Windows / LinuxShift + Alt + I macOSShift + Option + I |
| Select all occurrences of the current selection | Windows / LinuxCtrl + Shift + L macOSCmd + Shift + L |
| Select all occurrences of the current word | Windows / LinuxCtrl + F2 macOSCmd + F2 |
| Select the current line | Windows / LinuxCtrl + L macOSCmd + L |
| Insert a cursor below | WindowsCtrl + Alt + Down macOSOption + Cmd + Down LinuxShift + Alt + Down |
| Insert a cursor above | WindowsCtrl + Alt + Up macOSOption + Cmd + Up LinuxShift + Alt + Up |
| Jump to the matching bracket | Windows / LinuxCtrl + Shift + \ macOSShift + Cmd + \ |
| Indent the line | Windows / LinuxCtrl + ] macOSCmd + ] |
| Outdent the line | Windows / LinuxCtrl + [ macOSCmd + [ |
| Go to the beginning of the line | Windows / macOS / LinuxHome |
| Go to the end of the line | Windows / macOS / LinuxEnd |
| Go to the beginning of the file | Windows / LinuxCtrl + Home macOSCmd + Up |
| Go to the end of the file | Windows / LinuxCtrl + End macOSCmd + Down |
| Scroll one line down | Windows / LinuxCtrl + Down macOSCtrl + PageDown |
| Scroll one line up | Windows / LinuxCtrl + Up macOSCtrl + PageUp |
| Scroll one page down | Windows / LinuxAlt + PageDown macOSCmd + PageDown |
| Scroll one page up | Windows / LinuxAlt + PageUp macOSCmd + PageUp |
| Select all | Windows / LinuxCtrl + A macOSCmd + A |
Rich language editing
Use IntelliSense, formatting, refactoring, comments, folds, and language-aware navigation when a language service is available.
| Action | Shortcuts |
|---|---|
| Fold the current region | Windows / LinuxCtrl + Shift + [ macOSOption + Cmd + [ |
| Unfold the current region | Windows / LinuxCtrl + Shift + ] macOSOption + Cmd + ] |
| Toggle the current foldTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + L macOSCmd + K then Cmd + L |
| Fold all subregionsTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + [ macOSCmd + K then Cmd + [ |
| Unfold all subregionsTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + ] macOSCmd + K then Cmd + ] |
| Fold all regionsTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + 0 macOSCmd + K then Cmd + 0 |
| Unfold all regionsTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + J macOSCmd + K then Cmd + J |
| Add a line commentTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + C macOSCmd + K then Cmd + C |
| Remove a line commentTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + U macOSCmd + K then Cmd + U |
| Toggle a line comment | Windows / LinuxCtrl + / macOSCmd + / |
| Toggle a block comment | WindowsShift + Alt + A macOSShift + Option + A LinuxCtrl + Shift + A |
| Trigger suggestions | Windows / macOS / LinuxCtrl + Space |
| Trigger parameter hints | Windows / LinuxCtrl + Shift + Space macOSShift + Cmd + Space |
| Format the document | WindowsShift + Alt + F macOSShift + Option + F LinuxCtrl + Shift + I |
| Format the selectionTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + F macOSCmd + K then Cmd + F |
| Go to definition | Windows / macOS / LinuxF12 |
| Show hover informationTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + I macOSCmd + K then Cmd + I |
| Peek the definition | WindowsAlt + F12 macOSOption + F12 LinuxCtrl + Shift + F10 |
| Open the definition to the sideTwo-stroke chord. | Windows / LinuxCtrl + K then F12 macOSCmd + K then F12 |
| Open quick fixes | Windows / LinuxCtrl + . macOSCmd + . |
| Go to references | Windows / macOS / LinuxShift + F12 |
| Rename the symbol | Windows / macOS / LinuxF2 |
| Replace with the next value | Windows / LinuxCtrl + Shift + . macOSShift + Cmd + . |
| Replace with the previous value | Windows / LinuxCtrl + Shift + , macOSShift + Cmd + , |
| Expand the syntax-tree selection | Windows / LinuxShift + Alt + Right macOSCtrl + Shift + Cmd + Right |
| Shrink the syntax-tree selection | Windows / LinuxShift + Alt + Left macOSCtrl + Shift + Cmd + Left |
| Trim trailing whitespaceTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + X macOSCmd + K then Cmd + X |
| Change the language modeTwo-stroke chord. | Windows / LinuxCtrl + K then M macOSCmd + K then M |
Editor, window, and group management
Split editors, move groups, close and reopen tabs, and focus the part of the workspace you need.
| Action | Shortcuts |
|---|---|
| Open a new window | Windows / LinuxCtrl + Shift + N macOSCmd + Shift + N |
| Close the window | WindowsAlt + F4 macOSCmd + Shift + W LinuxCtrl + Shift + W |
| Close the active editor | WindowsCtrl + F4 macOSCmd + W LinuxCtrl + W |
| Close the current folderTwo-stroke chord. | Windows / LinuxCtrl + K then F macOSCmd + K then F |
| Split the editor | Windows / LinuxCtrl + \ macOSCmd + \ |
| Focus the first editor group | Windows / LinuxCtrl + 1 macOSCmd + 1 |
| Focus the second editor group | Windows / LinuxCtrl + 2 macOSCmd + 2 |
| Focus the third editor group | Windows / LinuxCtrl + 3 macOSCmd + 3 |
| Focus the editor group on the leftTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + Left macOSCmd + K then Cmd + Left |
| Focus the editor group on the rightTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + Right macOSCmd + K then Cmd + Right |
| Move the editor left in its group | Windows / LinuxCtrl + Shift + PageUp macOSCmd + K then Shift + Cmd + Left |
| Move the editor right in its group | Windows / LinuxCtrl + Shift + PageDown macOSCmd + K then Shift + Cmd + Right |
| Move the active editor group leftTwo-stroke chord. | Windows / LinuxCtrl + K then Left macOSCmd + K then Left |
| Move the active editor group rightTwo-stroke chord. | Windows / LinuxCtrl + K then Right macOSCmd + K then Right |
| Move the editor to the next group | Windows / LinuxCtrl + Alt + Right macOSCtrl + Cmd + Right |
| Move the editor to the previous group | Windows / LinuxCtrl + Alt + Left macOSCtrl + Cmd + Left |
Files, display, and terminal
Save and reopen work, manage tabs, change the workspace display, focus panels, and use the integrated terminal.
| Action | Shortcuts |
|---|---|
| Create a new file | Windows / LinuxCtrl + N macOSCmd + N |
| Open a file | Windows / LinuxCtrl + O macOSCmd + O |
| Save | Windows / LinuxCtrl + S macOSCmd + S |
| Save allThe current Linux default list does not assign a Save All key. | WindowsCtrl + K then S macOSOption + Cmd + S LinuxNot documented |
| Save as | Windows / LinuxCtrl + Shift + S macOSCmd + Shift + S |
| Close all editors in the groupTwo-stroke chord. | Windows / LinuxCtrl + K then W macOSCmd + K then W |
| Close all editorsTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + W macOSCmd + K then Cmd + W |
| Reopen the closed editor | Windows / LinuxCtrl + Shift + T macOSCmd + Shift + T |
| Keep the active editor openTwo-stroke chord. | Windows / LinuxCtrl + K then Enter macOSCmd + K then Enter |
| Copy the active file pathTwo-stroke chord. | Windows / LinuxCtrl + K then P macOSCmd + K then P |
| Reveal the active file in the file managerTwo-stroke chord. | Windows / LinuxCtrl + K then R macOSCmd + K then R |
| Toggle fullscreen | Windows / LinuxF11 macOSCtrl + Cmd + F |
| Toggle Zen ModeTwo-stroke chord. | Windows / LinuxCtrl + K then Z macOSCmd + K then Z |
| Leave Zen Mode | Windows / macOS / LinuxEsc then Esc |
| Zoom in | Windows / LinuxCtrl + = macOSCmd + = |
| Zoom out | Windows / LinuxCtrl + - macOSCmd + - |
| Reset zoom | Windows / LinuxCtrl + Numpad0 macOSCmd + Numpad0 |
| Toggle sidebar visibility | Windows / LinuxCtrl + B macOSCmd + B |
| Show Explorer and focus it | Windows / LinuxCtrl + Shift + E macOSCmd + Shift + E |
| Show Search | Windows / LinuxCtrl + Shift + F macOSCmd + Shift + F |
| Show Source Control | Windows / macOS / LinuxCtrl + Shift + G |
| Show Run and Debug | Windows / LinuxCtrl + Shift + D macOSCmd + Shift + D |
| Show Extensions | Windows / LinuxCtrl + Shift + X macOSCmd + Shift + X |
| Toggle the Output panel | WindowsCtrl + Shift + U macOSCmd + Shift + U LinuxCtrl + K then Ctrl + H |
| Open Quick Open ViewThe current Linux default list does not assign this key. | Windows / macOSCtrl + Q LinuxNot documented |
| Open a new command prompt | Windows / LinuxCtrl + Shift + C macOSCmd + Shift + C |
| Toggle Markdown preview | Windows / LinuxCtrl + Shift + V macOSCmd + Shift + V |
| Open preview to the sideTwo-stroke chord. | Windows / LinuxCtrl + K then V macOSCmd + K then V |
| Toggle the integrated terminal | Windows / macOS / LinuxCtrl + ` |
Search and Search Editor
Search within files and workspaces, change search behavior, move through terms, and open results in a dedicated editor.
| Action | Shortcuts |
|---|---|
| Find in the current file | Windows / LinuxCtrl + F macOSCmd + F |
| Replace in the current file | Windows / LinuxCtrl + H macOSOption + Cmd + F |
| Replace in files | Windows / LinuxCtrl + Shift + H macOSCmd + Shift + H |
| Toggle match case | Windows / LinuxAlt + C macOSOption + Cmd + C |
| Toggle match whole word | Windows / LinuxAlt + W macOSOption + Cmd + W |
| Toggle regular expression search | Windows / LinuxAlt + R macOSOption + Cmd + R |
| Toggle search details | Windows / LinuxCtrl + Shift + J macOSCmd + Shift + J |
| Focus the next search result | Windows / macOS / LinuxF4 |
| Focus the previous search result | Windows / macOS / LinuxShift + F4 |
| Show the next search term | Windows / macOS / LinuxDown |
| Show the previous search term | Windows / macOS / LinuxUp |
| Open search results in an editor | Windows / LinuxAlt + Enter macOSCmd + Enter |
| Focus the Search Editor input | Windows / macOS / LinuxEsc |
| Search again in the Search Editor | Windows / LinuxCtrl + Shift + R macOSCmd + Shift + R |
| Delete Search Editor file results | Windows / LinuxCtrl + Shift + Backspace macOSCmd + Shift + Backspace |
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 | Shortcuts |
|---|---|
| Open Settings | Windows / LinuxCtrl + , macOSCmd + , |
| Open Keyboard ShortcutsTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + S macOSCmd + K then Cmd + S |
| Select a color themeTwo-stroke chord. | Windows / LinuxCtrl + K then Ctrl + T macOSCmd + K then Cmd + T |
| Open Chat view | Windows / LinuxCtrl + Alt + I macOSCtrl + Cmd + I |
| Open chat in agent mode | WindowsCtrl + Shift + I macOSShift + Cmd + I LinuxCtrl + Shift + Alt + I |
| Open editor inline chat | Windows / LinuxCtrl + I macOSCmd + I |
| Open terminal inline chat | Windows / LinuxCtrl + I macOSCmd + I |
| Open quick chat | Windows / LinuxCtrl + Shift + Alt + L macOSShift + Option + Cmd + L |
| Open the chat agent picker | Windows / LinuxCtrl + . macOSCmd + . |
| Open the language model picker | Windows / LinuxCtrl + Alt + . macOSOption + Cmd + . |
| Start a new chat session | Windows / LinuxCtrl + N macOSCmd + N |
| Accept an inline suggestion | Windows / macOS / LinuxTab |
| Toggle a breakpoint | Windows / macOS / LinuxF9 |
| Start debugging | Windows / macOS / LinuxF5 |
| Continue debugging | Windows / macOS / LinuxF5 |
| Run without debugging | Windows / macOS / LinuxCtrl + F5 |
| Pause debugging | Windows / macOS / LinuxF6 |
| Step into | Windows / macOS / LinuxF11 |
| Run the build task | Windows / LinuxCtrl + Shift + B macOSCmd + Shift + B |
Source
official VS Code default keyboard shortcuts · Checked
Common default keybindings from the official VS Code reference checked in August 2026. The full installed list is generated by VS Code and can differ with extensions, profiles, keyboard layout, or user keybindings; open Preferences: Open Default Keyboard Shortcuts (JSON) for the complete runtime list.