メインコンテンツまでスキップ

Key Bindings for Visual Studio Code

Visual Studio Code lets you perform most tasks directly from the keyboard. This page lists out the default bindings (keyboard shortcuts) and describes how you can update them.

Note: If you visit this page on a Mac, you will see the key bindings for the Mac. If you visit using Windows or Linux, you will see the keys for that platform. If you need the key bindings for another platform, hover your mouse over the key you are interested in.

Keyboard Shortcuts editor

VS Code provides a rich keyboard shortcut editing experience with the Keyboard Shortcuts editor. The editor lists all available commands with and without keybindings, and enables you to change / remove / reset their keybindings using the available actions. You can use the search box to find commands or keybindings. You can open this editor by going to the menu under File > Preferences > Keyboard Shortcuts or by using the Preferences: Open Keyboard Shortcuts command (Ctrl+K Ctrl+S).

Keyboard Shortcuts

Most importantly, you can see keybindings according to your keyboard layout. For example, key binding Cmd+\ in US keyboard layout will be shown as Ctrl+Shift+Alt+Cmd+7 when layout is changed to German. The dialog to enter key binding will assign the correct and desired key binding as per your keyboard layout.

For doing more advanced keyboard shortcut customization, read Advanced Customization.

Customize shortcuts for UI actions

You can quickly customize the keybinding for user interface actions. Right-click on any action item in your workbench, and select Customize Keybinding. If the action has a when clause, it's automatically included, making it easier to set up your keybindings just the way you need them.

Keymap extensions

Keyboard shortcuts are vital to productivity and changing keyboarding habits can be tough. To help with this, File > Preferences > Migrate Keyboard Shortcuts from... shows you a list of popular keymap extensions. These extensions modify the VS Code shortcuts to match those of other editors so you don't need to learn new keyboard shortcuts. There is also a Keymaps category of extensions in the Marketplace.

Tip: Click on an extension tile above to read the description and reviews to decide which extension is best for you. See more in the Marketplace.

Keyboard Shortcuts Reference

We also have a printable version of these keyboard shortcuts. Help > Keyboard Shortcut Reference displays a condensed PDF version suitable for printing as an easy reference.

Below are links to the three platform-specific versions (US English keyboard):

Detecting keybinding conflicts

If you have many extensions installed or you have customized your keyboard shortcuts, you can sometimes have keybinding conflicts where the same keyboard shortcut is mapped to several commands. This can result in confusing behavior, especially if different keybindings are going in and out of scope as you move around the editor.

The Keyboard Shortcuts editor has a context menu command Show Same Keybindings, which will filter the keybindings based on a keyboard shortcut to display conflicts.

show keybinding conflicts menu

Pick a command with the keybinding you think is overloaded and you can see if multiple commands are defined, the source of the keybindings and when they are active.

show keybinding conflicts result

Troubleshooting keybindings

To troubleshoot keybindings problems, you can execute the command Developer: Toggle Keyboard Shortcuts Troubleshooting. This will activate logging of dispatched keyboard shortcuts and will open an output panel with the corresponding log file.

You can then press your desired keybinding and check what keyboard shortcut VS Code detects and what command is invoked.

For example, when pressing cmd+/ in a code editor on macOS, the logging output would be:

[KeybindingService]: / Received  keydown event - modifiers: [meta], code: MetaLeft, keyCode: 91, key: Meta
[KeybindingService]: | Converted keydown event - modifiers: [meta], code: MetaLeft, keyCode: 57 ('Meta')
[KeybindingService]: \ Keyboard event cannot be dispatched.
[KeybindingService]: / Received keydown event - modifiers: [meta], code: Slash, keyCode: 191, key: /
[KeybindingService]: | Converted keydown event - modifiers: [meta], code: Slash, keyCode: 85 ('/')
[KeybindingService]: | Resolving meta+[Slash]
[KeybindingService]: \ From 2 keybinding entries, matched editor.action.commentLine, when: editorTextFocus && !editorReadonly, source: built-in.

The first keydown event is for the MetaLeft key (cmd) and cannot be dispatched. The second keydown event is for the Slash key (/) and is dispatched as meta+[Slash]. There were two keybinding entries mapped from meta+[Slash] and the one that matched was for the command editor.action.commentLine, which has the when condition editorTextFocus && !editorReadonly and is a built-in keybinding entry.

Viewing modified keybindings

You can view any user modified keyboard shortcuts in VS Code in the Keyboard Shortcuts editor with the Show User Keybindings command in the More Actions (...) menu. This applies the @source:user filter to the Keyboard Shortcuts editor (Source is 'User').

Default Keyboard Shortcuts

Advanced customization

All keyboard shortcuts in VS Code can be customized via the keybindings.json file, where you can overwrite the Default Keyboard Shortcuts.

To open the keybindings.json file:

  • Open Keyboard Shortcuts editor, and then select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar.

    Open Keyboard Shortcuts JSON button in the Command Palette (Ctrl+Shift+P).

Keyboard rules

Each rule consists of:

  • a key that describes the pressed keys.
  • a command containing the identifier of the command to execute.
  • an optional when clause containing a boolean expression that will be evaluated depending on the current context.

Chords (two separate keypress actions) are described by separating the two keypresses with a space. For example, Ctrl+K Ctrl+C.

When a key is pressed:

  • the rules are evaluated from bottom to top.
  • the first rule that matches, both the key and in terms of when, is accepted.
  • no more rules are processed.
  • if a rule is found and has a command set, the command is executed.

The additional keybindings.json rules are appended at runtime to the bottom of the default rules, thus allowing them to overwrite the default rules. The keybindings.json file is watched by VS Code so editing it while VS Code is running will update the rules at runtime.

The keyboard shortcuts dispatching is done by analyzing a list of rules that are expressed in JSON. Here are some examples:

// Keybindings that are active when the focus is in the editor
{ "key": "home", "command": "cursorHome", "when": "editorTextFocus" },
{ "key": "shift+home", "command": "cursorHomeSelect", "when": "editorTextFocus" },

// Keybindings that are complementary
{ "key": "f5", "command": "workbench.action.debug.continue", "when": "inDebugMode" },
{ "key": "f5", "command": "workbench.action.debug.start", "when": "!inDebugMode" },

// Global keybindings
{ "key": "ctrl+f", "command": "actions.find" },
{ "key": "alt+left", "command": "workbench.action.navigateBack" },
{ "key": "alt+right", "command": "workbench.action.navigateForward" },

// Global keybindings using chords (two separate keypress actions)
{ "key": "ctrl+k enter", "command": "workbench.action.keepEditor" },
{ "key": "ctrl+k ctrl+w", "command": "workbench.action.closeAllEditors" },

Accepted keys

The key is made up of modifiers and the key itself.

The following modifiers are accepted:

PlatformModifiers
macOSCtrl+, Shift+, Alt+, Cmd+
WindowsCtrl+, Shift+, Alt+, Win+
LinuxCtrl+, Shift+, Alt+, Meta+

The following keys are accepted:

  • f1-f19, a-z, 0-9
  • `, -, =, [, ], \, ;, ', ,, ., /
  • left, up, right, down, pageup, pagedown, end, home
  • tab, enter, escape, space, backspace, delete
  • pausebreak, capslock, insert
  • numpad0-numpad9, numpad_multiply, numpad_add, numpad_separator
  • numpad_subtract, numpad_decimal, numpad_divide

Command arguments

You can invoke a command with arguments. This is useful if you often perform the same operation on a specific file or folder. You can add a custom keyboard shortcut to do exactly what you want.

The following is an example overriding the Enter key to print some text:

{
"key": "enter",
"command": "type",
"args": { "text": "Hello World" },
"when": "editorTextFocus"
}

The type command will receive {"text": "Hello World"} as its first argument and add "Hello World" to the file instead of producing the default command.

For more information on commands that take arguments, refer to Built-in Commands.

Running multiple commands

It is possible to create a keybinding that runs several other commands sequentially using the command runCommands.

  1. Run several commands without arguments: copy current line down, mark the current line as comment, move cursor to copied line
{
"key": "ctrl+alt+c",
"command": "runCommands",
"args": {
"commands": [
"editor.action.copyLinesDownAction",
"cursorUp",
"editor.action.addCommentLine",
"cursorDown"
]
}
},
  1. It is also possible to pass arguments to commands: create a new untitled TypeScript file and insert a custom snippet
{
"key": "ctrl+n",
"command": "runCommands",
"args": {
"commands": [
{
"command": "workbench.action.files.newUntitledFile",
"args": {
"languageId": "typescript"
}
},
{
"command": "editor.action.insertSnippet",
"args": {
"langId": "typescript",
"snippet": "class ${1:ClassName} {\n\tconstructor() {\n\t\t$0\n\t}\n}"
}
}
]
}
},

Note that commands run by runCommands receive the value of "args" as the first argument. So in the example above, workbench.action.files.newUntitledFile receives {"languageId": "typescript" } as its first and only argument.

To pass several arguments, one needs to have "args" as an array:

{
"key": "ctrl+shift+e",
"command": "runCommands",
"args": {
"commands": [
{
// command invoked with 2 arguments: vscode.executeCommand("myCommand", "arg1", "arg2")
"command": "myCommand",
"args": ["arg1", "arg2"]
}
]
}
}

To pass an array as the first argument, one needs to wrap the array in another array: "args": [ [1, 2, 3] ].

Removing a specific key binding rule

You can write a key binding rule that targets the removal of a specific default key binding. With the keybindings.json, it was always possible to redefine all the key bindings of VS Code, but it can be difficult to make a small tweak, especially around overloaded keys, such as Tab or Escape. To remove a specific key binding, add a - to the command and the rule will be a removal rule.

Here is an example:

// In Default Keyboard Shortcuts
...
{ "key": "tab", "command": "tab", "when": ... },
{ "key": "tab", "command": "jumpToNextSnippetPlaceholder", "when": ... },
{ "key": "tab", "command": "acceptSelectedSuggestion", "when": ... },
...

// To remove the second rule, for example, add in keybindings.json:
{ "key": "tab", "command": "-jumpToNextSnippetPlaceholder" }

To override a specific key binding rule with an empty action, you can specify an empty command:

// To override and disable any `tab` keybinding, for example, add in keybindings.json:
{ "key": "tab", "command": "" }

Keyboard layouts

Note: This section relates only to key bindings, not to typing in the editor.

The keys above are string representations for virtual keys and do not necessarily relate to the produced character when they are pressed. More precisely:

  • Reference: Virtual-Key Codes (Windows)
  • tab for VK_TAB (0x09)
  • ; for VK_OEM_1 (0xBA)
  • = for VK_OEM_PLUS (0xBB)
  • , for VK_OEM_COMMA (0xBC)
  • - for VK_OEM_MINUS (0xBD)
  • . for VK_OEM_PERIOD (0xBE)
  • / for VK_OEM_2 (0xBF)
  • ` for VK_OEM_3 (0xC0)
  • [ for VK_OEM_4 (0xDB)
  • \ for VK_OEM_5 (0xDC)
  • ] for VK_OEM_6 (0xDD)
  • ' for VK_OEM_7 (0xDE)
  • etc.

Different keyboard layouts usually reposition the above virtual keys or change the characters produced when they are pressed. When using a different keyboard layout than the standard US, Visual Studio Code does the following:

All the key bindings are rendered in the UI using the current system's keyboard layout. For example, Split Editor when using a French (France) keyboard layout is now rendered as Ctrl+*:

render key binding

When editing keybindings.json, VS Code highlights misleading key bindings, those that are represented in the file with the character produced under the standard US keyboard layout, but that need pressing keys with different labels under the current system's keyboard layout. For example, here is how the Default Keyboard Shortcuts rules look like when using a French (France) keyboard layout:

keybindings.json guidance

There is also a widget that helps input the key binding rule when editing keybindings.json. To launch the Define Keybinding widget, press kb(editor.action.defineKeybinding). The widget listens for key presses and renders the serialized JSON representation in the text box and below it, the keys that VS Code has detected under your current keyboard layout. Once you've typed the key combination you want, you can press Enter and a rule snippet will be inserted.

key binding widget

Note: On Linux, Visual Studio Code detects your current keyboard layout on start-up and then caches this information. For a good experience, we recommend restarting VS Code if you change your keyboard layout.

Keyboard layout-independent bindings

Using scan codes, it is possible to define keybindings which do not change with the change of the keyboard layout. For example:

{
"key": "cmd+[Slash]",
"command": "editor.action.commentLine",
"when": "editorTextFocus"
}

Accepted scan codes:

  • [F1]-[F19], [KeyA]-[KeyZ], [Digit0]-[Digit9]
  • [Backquote], [Minus], [Equal], [BracketLeft], [BracketRight], [Backslash], [Semicolon], [Quote], [Comma], [Period], [Slash]
  • [ArrowLeft], [ArrowUp], [ArrowRight], [ArrowDown], [PageUp], [PageDown], [End], [Home]
  • [Tab], [Enter], [Escape], [Space], [Backspace], [Delete]
  • [Pause], [CapsLock], [Insert]
  • [Numpad0]-[Numpad9], [NumpadMultiply], [NumpadAdd], [NumpadComma]
  • [NumpadSubtract], [NumpadDecimal], [NumpadDivide]

when clause contexts

VS Code gives you fine control over when your key bindings are enabled through the optional when clause. If your key binding doesn't have a when clause, the key binding is globally available at all times. A when clause evaluates to either Boolean true or false for enabling key bindings.

VS Code sets various context keys and specific values depending on what elements are visible and active in the VS Code UI. For example, the built-in Start Debugging command has the keyboard shortcut F5, which is only enabled when there is an appropriate debugger available (context debuggersAvailable is true) and the editor isn't in debug mode (context inDebugMode is false):

Start Debugging when clause in the Keyboard Shorts editor

You can also view a keybinding's when clause directly in the Default Keybindings JSON (Preferences: Open Default Keyboard Shortcuts (JSON)):

{ "key": "f5",  "command": "workbench.action.debug.start",
"when": "debuggersAvailable && !inDebugMode" },

Conditional operators

For when clause conditional expressions, the following conditional operators are useful for keybindings:

OperatorSymbolExample
Equality=="editorLangId == typescript"
Inequality!="resourceExtname != .js"
Or||"isLinux||isWindows"
And&&"textInputFocus && !editorReadonly"
Matches=~"resourceScheme =~ /^untitled$|^file$/"

You can find the full list of when clause conditional operators in the when clause contexts reference.

Available contexts

You can find some of the available when clause contexts in the when clause context reference.

The list there isn't exhaustive and you can find other when clause contexts by searching and filtering in the Keyboard Shortcuts editor (Preferences: Open Keyboard Shortcuts ) or reviewing the Default Keybindings JSON file (Preferences: Open Default Keyboard Shortcuts (JSON)).

Custom keybindings for refactorings

The editor.action.codeAction command lets you configure keybindings for specific Refactorings (Code Actions). For example, the keybinding below triggers the Extract function refactoring Code Actions:

{
"key": "ctrl+shift+r ctrl+e",
"command": "editor.action.codeAction",
"args": {
"kind": "refactor.extract.function"
}
}

This is covered in depth in the Refactoring topic where you can learn about different kinds of Code Actions and how to prioritize them in the case of multiple possible refactorings.

Default Keyboard Shortcuts

You can view all default keyboard shortcuts in VS Code in the Keyboard Shortcuts editor with the Show Default Keybindings command in the More Actions (...) menu. This applies the @source:default filter to the Keyboard Shortcuts editor (Source is 'Default').

Default Keyboard Shortcuts

You can view the default keyboard shortcuts as a JSON file using the command Preferences: Open Default Keyboard Shortcuts (JSON).

Note: The following keys are rendered assuming a standard US keyboard layout. If you use a different keyboard layout, please read below. You can view the currently active keyboard shortcuts in VS Code in the Command Palette (View -> Command Palette) or in the Keyboard Shortcuts editor (File > Preferences > Keyboard Shortcuts).

Some commands included below do not have default keyboard shortcuts and so are displayed as unassigned but you can assign your own keybindings.

Basic Editing

CommandKeyCommand id
Cut line (empty selection)kb(editor.action.clipboardCutAction)editor.action.clipboardCutAction
Copy line (empty selection)kb(editor.action.clipboardCopyAction)editor.action.clipboardCopyAction
Pastekb(editor.action.clipboardPasteAction)editor.action.clipboardPasteAction
Delete Linekb(editor.action.deleteLines)editor.action.deleteLines
Insert Line Belowkb(editor.action.insertLineAfter)editor.action.insertLineAfter
Insert Line Abovekb(editor.action.insertLineBefore)editor.action.insertLineBefore
Move Line Downkb(editor.action.moveLinesDownAction)editor.action.moveLinesDownAction
Move Line Upkb(editor.action.moveLinesUpAction)editor.action.moveLinesUpAction
Copy Line Downkb(editor.action.copyLinesDownAction)editor.action.copyLinesDownAction
Copy Line Upkb(editor.action.copyLinesUpAction)editor.action.copyLinesUpAction
Undokb(undo)undo
Redokb(redo)redo
Add Selection To Next Find Matchkb(editor.action.addSelectionToNextFindMatch)editor.action.addSelectionToNextFindMatch
Move Last Selection To Next Find Matchkb(editor.action.moveSelectionToNextFindMatch)editor.action.moveSelectionToNextFindMatch
Undo last cursor operationkb(cursorUndo)cursorUndo
Insert cursor at end of each line selectedkb(editor.action.insertCursorAtEndOfEachLineSelected)editor.action.insertCursorAtEndOfEachLineSelected
Select all occurrences of current selectionkb(editor.action.selectHighlights)editor.action.selectHighlights
Select all occurrences of current wordkb(editor.action.changeAll)editor.action.changeAll
Select current linekb(expandLineSelection)expandLineSelection
Insert Cursor Belowkb(editor.action.insertCursorBelow)editor.action.insertCursorBelow
Insert Cursor Abovekb(editor.action.insertCursorAbove)editor.action.insertCursorAbove
Jump to matching bracketkb(editor.action.jumpToBracket)editor.action.jumpToBracket
Indent Linekb(editor.action.indentLines)editor.action.indentLines
Outdent Linekb(editor.action.outdentLines)editor.action.outdentLines
Go to Beginning of Linekb(cursorHome)cursorHome
Go to End of Linekb(cursorEnd)cursorEnd
Go to End of Filekb(cursorBottom)cursorBottom
Go to Beginning of Filekb(cursorTop)cursorTop
Scroll Line Downkb(scrollLineDown)scrollLineDown
Scroll Line Upkb(scrollLineUp)scrollLineUp
Scroll Page Downkb(scrollPageDown)scrollPageDown
Scroll Page Upkb(scrollPageUp)scrollPageUp
Fold (collapse) regionkb(editor.fold)editor.fold
Unfold (uncollapse) regionkb(editor.unfold)editor.unfold
Toggle Fold regionkb(editor.toggleFold)editor.toggleFold
Fold (collapse) all subregionskb(editor.foldRecursively)editor.foldRecursively
Unfold (uncollapse) all subregionskb(editor.unfoldRecursively)editor.unfoldRecursively
Fold (collapse) all regionskb(editor.foldAll)editor.foldAll
Unfold (uncollapse) all regionskb(editor.unfoldAll)editor.unfoldAll
Add Line Commentkb(editor.action.addCommentLine)editor.action.addCommentLine
Remove Line Commentkb(editor.action.removeCommentLine)editor.action.removeCommentLine
Toggle Line Commentkb(editor.action.commentLine)editor.action.commentLine
Toggle Block Commentkb(editor.action.blockComment)editor.action.blockComment
Findkb(actions.find)actions.find
Replacekb(editor.action.startFindReplaceAction)editor.action.startFindReplaceAction
Find Nextkb(editor.action.nextMatchFindAction)editor.action.nextMatchFindAction
Find Previouskb(editor.action.previousMatchFindAction)editor.action.previousMatchFindAction
Select All Occurrences of Find Matchkb(editor.action.selectAllMatches)editor.action.selectAllMatches
Toggle Find Case Sensitivekb(toggleFindCaseSensitive)toggleFindCaseSensitive
Toggle Find Regexkb(toggleFindRegex)toggleFindRegex
Toggle Find Whole Wordkb(toggleFindWholeWord)toggleFindWholeWord
Toggle Use of Tab Key for Setting Focuskb(editor.action.toggleTabFocusMode)editor.action.toggleTabFocusMode
Toggle Render Whitespacekb(toggleRenderWhitespace)toggleRenderWhitespace
Toggle Word Wrapkb(editor.action.toggleWordWrap)editor.action.toggleWordWrap

Rich Languages Editing

CommandKeyCommand id
Trigger SuggestCtrl+Spaceeditor.action.triggerSuggest
Trigger Parameter Hintskb(editor.action.triggerParameterHints)editor.action.triggerParameterHints
Format Documentkb(editor.action.formatDocument)editor.action.formatDocument
Format Selectionkb(editor.action.formatSelection)editor.action.formatSelection
Go to DefinitionF12editor.action.revealDefinition
Show Hoverkb(editor.action.showHover)editor.action.showHover
Peek DefinitionAlt+F12editor.action.peekDefinition
Open Definition to the Sidekb(editor.action.revealDefinitionAside)editor.action.revealDefinitionAside
Quick Fixkb(editor.action.quickFix)editor.action.quickFix
Go to Referenceskb(editor.action.goToReferences)editor.action.goToReferences
Rename Symbolkb(editor.action.rename)editor.action.rename
Replace with Next Valuekb(editor.action.inPlaceReplace.down)editor.action.inPlaceReplace.down
Replace with Previous Valuekb(editor.action.inPlaceReplace.up)editor.action.inPlaceReplace.up
Expand AST Selectionkb(editor.action.smartSelect.expand)editor.action.smartSelect.expand
Shrink AST Selectionkb(editor.action.smartSelect.shrink)editor.action.smartSelect.shrink
Trim Trailing Whitespacekb(editor.action.trimTrailingWhitespace)editor.action.trimTrailingWhitespace
Change Language Modekb(workbench.action.editor.changeLanguageMode)workbench.action.editor.changeLanguageMode
CommandKeyCommand id
Show All Symbolskb(workbench.action.showAllSymbols)workbench.action.showAllSymbols
Go to Line...kb(workbench.action.gotoLine)workbench.action.gotoLine
Go to File..., Quick Openkb(workbench.action.quickOpen)workbench.action.quickOpen
Go to Symbol...kb(workbench.action.gotoSymbol)workbench.action.gotoSymbol
Show ProblemsCtrl+Shift+Mworkbench.actions.view.problems
Go to Next Error or Warningkb(editor.action.marker.nextInFiles)editor.action.marker.nextInFiles
Go to Previous Error or Warningkb(editor.action.marker.prevInFiles)editor.action.marker.prevInFiles
Show All CommandsCtrl+Shift+P or F1workbench.action.showCommands
Navigate Editor Group Historykb(workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup)workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup
Go Backkb(workbench.action.navigateBack)workbench.action.navigateBack
Go back in Quick Inputkb(workbench.action.quickInputBack)workbench.action.quickInputBack
Go Forwardkb(workbench.action.navigateForward)workbench.action.navigateForward
Focus Breadcrumbskb(breadcrumbs.focus)breadcrumbs.focus
Focus and Select Breadcrumbskb(breadcrumbs.focusAndSelect)breadcrumbs.focusAndSelect

Editor/Window Management

CommandKeyCommand id
New Windowkb(workbench.action.newWindow)workbench.action.newWindow
Close Windowkb(workbench.action.closeWindow)workbench.action.closeWindow
Close Editorkb(workbench.action.closeActiveEditor)workbench.action.closeActiveEditor
Close Folderkb(workbench.action.closeFolder)workbench.action.closeFolder
Cycle Between Editor Groupskb(workbench.action.navigateEditorGroups)workbench.action.navigateEditorGroups
Split Editorkb(workbench.action.splitEditor)workbench.action.splitEditor
Focus into First Editor Groupkb(workbench.action.focusFirstEditorGroup)workbench.action.focusFirstEditorGroup
Focus into Second Editor Groupkb(workbench.action.focusSecondEditorGroup)workbench.action.focusSecondEditorGroup
Focus into Third Editor Groupkb(workbench.action.focusThirdEditorGroup)workbench.action.focusThirdEditorGroup
Focus into Editor Group on the Leftkb(workbench.action.focusPreviousGroup)workbench.action.focusPreviousGroup
Focus into Editor Group on the Rightkb(workbench.action.focusNextGroup)workbench.action.focusNextGroup
Move Editor Leftkb(workbench.action.moveEditorLeftInGroup)workbench.action.moveEditorLeftInGroup
Move Editor Rightkb(workbench.action.moveEditorRightInGroup)workbench.action.moveEditorRightInGroup
Move Active Editor Group Leftkb(workbench.action.moveActiveEditorGroupLeft)workbench.action.moveActiveEditorGroupLeft
Move Active Editor Group Rightkb(workbench.action.moveActiveEditorGroupRight)workbench.action.moveActiveEditorGroupRight
Move Editor into Next Groupkb(workbench.action.moveEditorToNextGroup)workbench.action.moveEditorToNextGroup
Move Editor into Previous Groupkb(workbench.action.moveEditorToPreviousGroup)workbench.action.moveEditorToPreviousGroup

File Management

CommandKeyCommand id
New Filekb(workbench.action.files.newUntitledFile)workbench.action.files.newUntitledFile
Open File...Ctrl+K Ctrl+Oworkbench.action.files.openFile
SaveCtrl+Sworkbench.action.files.save
Save Allkb(saveAll)saveAll
Save As...kb(workbench.action.files.saveAs)workbench.action.files.saveAs
Closekb(workbench.action.closeActiveEditor)workbench.action.closeActiveEditor
Close Otherskb(workbench.action.closeOtherEditors)workbench.action.closeOtherEditors
Close Groupkb(workbench.action.closeEditorsInGroup)workbench.action.closeEditorsInGroup
Close Other Groupskb(workbench.action.closeEditorsInOtherGroups)workbench.action.closeEditorsInOtherGroups
Close Group to Leftkb(workbench.action.closeEditorsToTheLeft)workbench.action.closeEditorsToTheLeft
Close Group to Rightkb(workbench.action.closeEditorsToTheRight)workbench.action.closeEditorsToTheRight
Close Allkb(workbench.action.closeAllEditors)workbench.action.closeAllEditors
Reopen Closed Editorkb(workbench.action.reopenClosedEditor)workbench.action.reopenClosedEditor
Keep Openkb(workbench.action.keepEditor)workbench.action.keepEditor
Copy Path of Active Filekb(workbench.action.files.copyPathOfActiveFile)workbench.action.files.copyPathOfActiveFile
Reveal Active File in Windowskb(workbench.action.files.revealActiveFileInWindows)workbench.action.files.revealActiveFileInWindows
Show Opened File in New Windowkb(workbench.action.files.showOpenedFileInNewWindow)workbench.action.files.showOpenedFileInNewWindow
Compare Opened File Withkb(workbench.files.action.compareFileWith)workbench.files.action.compareFileWith

Display

CommandKeyCommand id
Toggle Full Screenkb(workbench.action.toggleFullScreen)workbench.action.toggleFullScreen
Toggle Zen Modekb(workbench.action.toggleZenMode)workbench.action.toggleZenMode
Leave Zen Modekb(workbench.action.exitZenMode)workbench.action.exitZenMode
Zoom inkb(workbench.action.zoomIn)workbench.action.zoomIn
Zoom outkb(workbench.action.zoomOut)workbench.action.zoomOut
Reset Zoomkb(workbench.action.zoomReset)workbench.action.zoomReset
Toggle Sidebar Visibilitykb(workbench.action.toggleSidebarVisibility)workbench.action.toggleSidebarVisibility
Show Explorer / Toggle FocusCtrl+Shift+Eworkbench.view.explorer
Show Searchkb(workbench.view.search)workbench.view.search
Show Source ControlCtrl+Shift+Gworkbench.view.scm
Show RunCtrl+Shift+Dworkbench.view.debug
Show ExtensionsCtrl+Shift+Xworkbench.view.extensions
Show Outputkb(workbench.action.output.toggleOutput)workbench.action.output.toggleOutput
Quick Open Viewkb(workbench.action.quickOpenView)workbench.action.quickOpenView
Open New Command PromptCtrl+Shift+Cworkbench.action.terminal.openNativeConsole
Toggle Markdown PreviewCtrl+Shift+Vmarkdown.showPreview
Open Preview to the SideCtrl+K Vmarkdown.showPreviewToSide
Toggle Integrated TerminalCtrl+`workbench.action.terminal.toggleTerminal
CommandKeyCommand id
Show Searchkb(workbench.view.search)workbench.view.search
Replace in Fileskb(workbench.action.replaceInFiles)workbench.action.replaceInFiles
Toggle Match Casekb(toggleSearchCaseSensitive)toggleSearchCaseSensitive
Toggle Match Whole Wordkb(toggleSearchWholeWord)toggleSearchWholeWord
Toggle Use Regular Expressionkb(toggleSearchRegex)toggleSearchRegex
Toggle Search Detailskb(workbench.action.search.toggleQueryDetails)workbench.action.search.toggleQueryDetails
Focus Next Search Resultkb(search.action.focusNextSearchResult)search.action.focusNextSearchResult
Focus Previous Search Resultkb(search.action.focusPreviousSearchResult)search.action.focusPreviousSearchResult
Show Next Search Termkb(history.showNext)history.showNext
Show Previous Search Termkb(history.showPrevious)history.showPrevious

Search Editor

CommandKeyCommand id
Open Results In Editorkb(search.action.openInEditor)search.action.openInEditor
Focus Search Editor Inputkb(search.action.focusQueryEditorWidget)search.action.focusQueryEditorWidget
Search Againkb(rerunSearchEditorSearch)rerunSearchEditorSearch
Delete File Resultskb(search.searchEditor.action.deleteFileResults)search.searchEditor.action.deleteFileResults

Preferences

CommandKeyCommand id
Open Settingskb(workbench.action.openSettings)workbench.action.openSettings
Open Workspace Settingskb(workbench.action.openWorkspaceSettings)workbench.action.openWorkspaceSettings
Open Keyboard ShortcutsCtrl+K Ctrl+Sworkbench.action.openGlobalKeybindings
Open User Snippetskb(workbench.action.openSnippets)workbench.action.openSnippets
Select Color Themekb(workbench.action.selectTheme)workbench.action.selectTheme
Configure Display Languagekb(workbench.action.configureLocale)workbench.action.configureLocale

Debug

CommandKeyCommand id
Toggle BreakpointF9editor.debug.action.toggleBreakpoint
StartF5workbench.action.debug.start
ContinueF5workbench.action.debug.continue
Start (without debugging)Ctrl+F5workbench.action.debug.run
Pausekb(workbench.action.debug.pause)workbench.action.debug.pause
Step IntoF11workbench.action.debug.stepInto

Tasks

CommandKeyCommand id
Run Build TaskCtrl+Shift+Bworkbench.action.tasks.build
Run Test Taskkb(workbench.action.tasks.test)workbench.action.tasks.test

Extensions

CommandKeyCommand id
Install Extensionkb(workbench.extensions.action.installExtension)workbench.extensions.action.installExtension
Show Installed Extensionskb(workbench.extensions.action.showInstalledExtensions)workbench.extensions.action.showInstalledExtensions
Show Outdated Extensionskb(workbench.extensions.action.listOutdatedExtensions)workbench.extensions.action.listOutdatedExtensions
Show Recommended Extensionskb(workbench.extensions.action.showRecommendedExtensions)workbench.extensions.action.showRecommendedExtensions
Show Popular Extensionskb(workbench.extensions.action.showPopularExtensions)workbench.extensions.action.showPopularExtensions
Update All Extensionskb(workbench.extensions.action.updateAllExtensions)workbench.extensions.action.updateAllExtensions

Next steps

Now that you know about our Key binding support, what's next...

  • Language Support - Our Good, Better, Best language grid to see what you can expect
  • Debugging - This is where VS Code really shines
  • Node.js - End to end Node.js scenario with a sample app

Common questions

How can I find out what command is bound to a specific key?

In the Keyboard Shortcut editor, you can filter on specific keystrokes to see which commands are bound to which keys. Below you can see that Ctrl+Shift+P is bound to Show All Commands to bring up the Command Palette.

Key bindings quick outline

How to add a key binding to an action, for example, add Ctrl+D to Delete Lines

Find a rule that triggers the action in the Default Keyboard Shortcuts and write a modified version of it in your keybindings.json file:

// Original, in Default Keyboard Shortcuts
{ "key": "ctrl+shift+k", "command": "editor.action.deleteLines",
"when": "editorTextFocus" },
// Modified, in User/keybindings.json, Ctrl+D now will also trigger this action
{ "key": "ctrl+d", "command": "editor.action.deleteLines",
"when": "editorTextFocus" },

How can I add a key binding for only certain file types?

Use the editorLangId context key in your when clause:

{ "key": "shift+alt+a",           "command": "editor.action.blockComment",
"when": "editorTextFocus && editorLangId == csharp" },

I have modified my key bindings in keybindings.json; why don't they work?

The most common problem is a syntax error in the file. Otherwise, try removing the when clause or picking a different key. Unfortunately, at this point, it is a trial and error process.