Default keyboard shortcuts reference
VS Code comes with a set of default keyboard shortcuts. This article lists the default keyboard shortcuts in VS Code.
You can also view the default shortcuts in the product:
- Open the Keyboard Shortcuts editor, and then select Show System Keybindings in the More Actions (...) menu.
- Select Preferences: Open Default Keyboard Shortcuts (JSON) in the Command Palette.
Note
The following keys are rendered assuming a standard US keyboard layout. Get more information about using a different keyboard layout.
Some commands included below do not have default keyboard shortcuts and so are displayed as unassigned but you can assign your own keyboard shortcuts.
Basic Editing
| Command | Key | Command id |
|---|---|---|
| Cut line (empty selection) | ⌘X (Windows, linux Ctrl+X) | editor.action.clipboardCutAction |
| Copy line (empty selection) | ⌘C (Windows, linux Ctrl+C) | editor.action.clipboardCopyAction |
| Paste | ⌘V (Windows, linux Ctrl+V) | editor.action.clipboardPasteAction |
| Delete Line | ⇧⌘K (Windows, linux Ctrl+Shift+K) | editor.action.deleteLines |
| Insert Line Below | ⌘Enter (Windows, linux Ctrl+Enter) | editor.action.insertLineAfter |
| Insert Line Above | ⇧⌘Enter (Windows, linux Ctrl+Shift+Enter) | editor.action.insertLineBefore |
| Move Line Down | ⌥↓ (Windows, linux Alt+Down) | editor.action.moveLinesDownAction |
| Move Line Up | ⌥↑ (Windows, linux Alt+Up) | editor.action.moveLinesUpAction |
| Copy Line Down | ⇧⌥↓ (Windows Shift+Alt+Down, linux Ctrl+Shift+Alt+Down) | editor.action.copyLinesDownAction |
| Copy Line Up | ⇧⌥↑ (Windows Shift+Alt+Up, linux Ctrl+Shift+Alt+Up) | editor.action.copyLinesUpAction |
| Undo | ⌘Z (Windows, linux Ctrl+Z) | undo |
| Redo | ⇧⌘Z (Windows, linux Ctrl+Y) | redo |
| Add Selection To Next Find Match | ⌘D (Windows, linux Ctrl+D) | editor.action.addSelectionToNextFindMatch |
| Move Last Selection To Next Find Match | ⌘K ⌘D (Windows, linux Ctrl+K Ctrl+D) | editor.action.moveSelectionToNextFindMatch |
| Undo last cursor operation | ⌘U (Windows, linux Ctrl+U) | cursorUndo |
| Insert cursor at end of each line selected | ⇧⌥I (Windows, linux Shift+Alt+I) | editor.action.insertCursorAtEndOfEachLineSelected |
| Select all occurrences of current selection | ⇧⌘L (Windows, linux Ctrl+Shift+L) | editor.action.selectHighlights |
| Select all occurrences of current word | ⌘F2 (Windows, linux Ctrl+F2) | editor.action.changeAll |
| Select current line | ⌘L (Windows, linux Ctrl+L) | expandLineSelection |
| Insert Cursor Below | ⌥⌘↓ (Windows Ctrl+Alt+Down, linux Shift+Alt+Down) | editor.action.insertCursorBelow |
| Insert Cursor Above | ⌥⌘↑ (Windows Ctrl+Alt+Up, linux Shift+Alt+Up) | editor.action.insertCursorAbove |
| Jump to matching bracket | ⇧⌘\ (Windows, linux Ctrl+Shift+\) | editor.action.jumpToBracket |
| Indent Line | ⌘] (Windows, linux Ctrl+]) | editor.action.indentLines |
| Outdent Line | ⌘[ (Windows, linux Ctrl+[) | editor.action.outdentLines |
| Go to Beginning of Line | Home | cursorHome |
| Go to End of Line | End | cursorEnd |
| Go to End of File | ⌘↓ (Windows, linux Ctrl+End) | cursorBottom |
| Go to Beginning of File | ⌘↑ (Windows, linux Ctrl+Home) | cursorTop |
| Scroll Line Down | ⌃PageDown (Windows, linux Ctrl+Down) | scrollLineDown |
| Scroll Line Up | ⌃PageUp (Windows, linux Ctrl+Up) | scrollLineUp |
| Scroll Page Down | ⌘PageDown (Windows, linux Alt+PageDown) | scrollPageDown |
| Scroll Page Up | ⌘PageUp (Windows, linux Alt+PageUp) | scrollPageUp |
| Fold (collapse) region | ⌥⌘[ (Windows, linux Ctrl+Shift+[) | editor.fold |
| Unfold (uncollapse) region | ⌥⌘] (Windows, linux Ctrl+Shift+]) | editor.unfold |
| Toggle Fold region | ⌘K ⌘L (Windows, linux Ctrl+K Ctrl+L) | editor.toggleFold |
| Fold (collapse) all subregions | ⌘K ⌘[ (Windows, linux Ctrl+K Ctrl+[) | editor.foldRecursively |
| Unfold (uncollapse) all subregions | ⌘K ⌘] (Windows, linux Ctrl+K Ctrl+]) | editor.unfoldRecursively |
| Fold (collapse) all regions | ⌘K ⌘0 (Windows, linux Ctrl+K Ctrl+0) | editor.foldAll |
| Unfold (uncollapse) all regions | ⌘K ⌘J (Windows, linux Ctrl+K Ctrl+J) | editor.unfoldAll |
| Add Line Comment | ⌘K ⌘C (Windows, linux Ctrl+K Ctrl+C) | editor.action.addCommentLine |
| Remove Line Comment | ⌘K ⌘U (Windows, linux Ctrl+K Ctrl+U) | editor.action.removeCommentLine |
| Toggle Line Comment | ⌘/ (Windows, linux Ctrl+/) | editor.action.commentLine |
| Toggle Block Comment | ⇧⌥A (Windows Shift+Alt+A, linux Ctrl+Shift+A) | editor.action.blockComment |
| Find | ⌘F (Windows, linux Ctrl+F) | actions.find |
| Replace | ⌥⌘F (Windows, linux Ctrl+H) | editor.action.startFindReplaceAction |
| Find Next | Enter | editor.action.nextMatchFindAction |
| Find Previous | ⇧Enter (Windows, linux Shift+Enter) | editor.action.previousMatchFindAction |
| Select All Occurrences of Find Match | ⌥Enter (Windows, linux Alt+Enter) | editor.action.selectAllMatches |
| Toggle Find Case Sensitive | ⌥⌘C (Windows, linux Alt+C) | toggleFindCaseSensitive |
| Toggle Find Regex | ⌥⌘R (Windows, linux Alt+R) | toggleFindRegex |
| Toggle Find Whole Word | ⌥⌘W (Windows, linux Alt+W) | toggleFindWholeWord |
| Toggle Use of Tab Key for Setting Focus | ⌃⇧M (Windows, linux Ctrl+M) | editor.action.toggleTabFocusMode |
| Toggle Render Whitespace | toggleRenderWhitespace |
|
| Toggle Word Wrap | ⌥Z (Windows, linux Alt+Z) | editor.action.toggleWordWrap |
Rich Languages Editing
| Command | Key | Command id |
|---|---|---|
| Trigger Suggest | ⌃Space (Windows, linux Ctrl+Space) | editor.action.triggerSuggest |
| Trigger Parameter Hints | ⇧⌘Space (Windows, linux Ctrl+Shift+Space) | editor.action.triggerParameterHints |
| Format Document | ⇧⌥F (Windows Shift+Alt+F, linux Ctrl+Shift+I) | editor.action.formatDocument |
| Format Selection | ⌘K ⌘F (Windows, linux Ctrl+K Ctrl+F) | editor.action.formatSelection |
| Go to Definition | F12 | editor.action.revealDefinition |
| Show Hover | ⌘K ⌘I (Windows, linux Ctrl+K Ctrl+I) | editor.action.showHover |
| Peek Definition | ⌥F12 (Windows Alt+F12, linux Ctrl+Shift+F10) | editor.action.peekDefinition |
| Open Definition to the Side | ⌘K F12 (Windows, linux Ctrl+K F12) | editor.action.revealDefinitionAside |
| Quick Fix | ⌘. (Windows, linux Ctrl+.) | editor.action.quickFix |
| Go to References | ⇧F12 (Windows, linux Shift+F12) | editor.action.goToReferences |
| Rename Symbol | F2 | editor.action.rename |
| Replace with Next Value | ⇧⌘. (Windows, linux Ctrl+Shift+.) | editor.action.inPlaceReplace.down |
| Replace with Previous Value | ⇧⌘, (Windows, linux Ctrl+Shift+,) | editor.action.inPlaceReplace.up |
| Expand AST Selection | ⌃⇧⌘→ (Windows, linux Shift+Alt+Right) | editor.action.smartSelect.expand |
| Shrink AST Selection | ⌃⇧⌘← (Windows, linux Shift+Alt+Left) | editor.action.smartSelect.shrink |
| Trim Trailing Whitespace | ⌘K ⌘X (Windows, linux Ctrl+K Ctrl+X) | editor.action.trimTrailingWhitespace |
| Change Language Mode | ⌘K M (Windows, linux Ctrl+K M) | workbench.action.editor.changeLanguageMode |
Navigation
| Command | Key | Command id |
|---|---|---|
| Show All Symbols | ⌘T (Windows, linux Ctrl+T) | workbench.action.showAllSymbols |
| Go to Line... | ⌃G (Windows, linux Ctrl+G) | workbench.action.gotoLine |
| Go to File..., Quick Open | ⌘P (Windows, linux Ctrl+P) | workbench.action.quickOpen |
| Go to Symbol... | ⇧⌘O (Windows, linux Ctrl+Shift+O) | workbench.action.gotoSymbol |
| Show Problems | ⇧⌘M (Windows, linux Ctrl+Shift+M) | workbench.actions.view.problems |
| Go to Next Error or Warning | F8 | editor.action.marker.nextInFiles |
| Go to Previous Error or Warning | ⇧F8 (Windows, linux Shift+F8) | editor.action.marker.prevInFiles |
| Show All Commands | ⇧⌘P (Windows, linux Ctrl+Shift+P) or F1 | workbench.action.showCommands |
| Navigate Editor Group History | ⌃Tab (Windows, linux Ctrl+Tab) | workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup |
| Go Back | ⌃- (Windows Alt+Left, linux Ctrl+Alt+-) | workbench.action.navigateBack |
| Go back in Quick Input | ⌃- (Windows Alt+Left, linux Ctrl+Alt+-) | workbench.action.quickInputBack |
| Go Forward | ⌃⇧- (Windows Alt+Right, linux Ctrl+Shift+-) | workbench.action.navigateForward |
| Focus Breadcrumbs | ⇧⌘; (Windows, linux Ctrl+Shift+;) | breadcrumbs.focus |
| Focus and Select Breadcrumbs | ⇧⌘. (Windows, linux Ctrl+Shift+.) | breadcrumbs.focusAndSelect |
Editor/Window Management
| Command | Key | Command id |
|---|---|---|
| New Window | ⇧⌘N (Windows, linux Ctrl+Shift+N) | workbench.action.newWindow |
| Close Window | ⌘W (Windows, linux Alt+F4) | workbench.action.closeWindow |
| Close Editor | ⌘W (Windows Ctrl+F4, linux Ctrl+W) | workbench.action.closeActiveEditor |
| Close Folder | ⌘K F (Windows, linux Ctrl+K F) | workbench.action.closeFolder |
| Cycle Between Editor Groups | workbench.action.navigateEditorGroups |
|
| Split Editor | ⌘\ (Windows, linux Ctrl+\) | workbench.action.splitEditor |
| Focus into First Editor Group | ⌘1 (Windows, linux Ctrl+1) | workbench.action.focusFirstEditorGroup |
| Focus into Second Editor Group | ⌘2 (Windows, linux Ctrl+2) | workbench.action.focusSecondEditorGroup |
| Focus into Third Editor Group | ⌘3 (Windows, linux Ctrl+3) | workbench.action.focusThirdEditorGroup |
| Focus into Editor Group on the Left | workbench.action.focusPreviousGroup |
|
| Focus into Editor Group on the Right | workbench.action.focusNextGroup |
|
| Move Editor Left | ⌘K ⇧⌘← (Windows, linux Ctrl+Shift+PageUp) | workbench.action.moveEditorLeftInGroup |
| Move Editor Right | ⌘K ⇧⌘→ (Windows, linux Ctrl+Shift+PageDown) | workbench.action.moveEditorRightInGroup |
| Move Active Editor Group Left | ⌘K ← (Windows, linux Ctrl+K Left) | workbench.action.moveActiveEditorGroupLeft |
| Move Active Editor Group Right | ⌘K → (Windows, linux Ctrl+K Right) | workbench.action.moveActiveEditorGroupRight |
| Move Editor into Next Group | ⌃⌘→ (Windows, linux Ctrl+Alt+Right) | workbench.action.moveEditorToNextGroup |
| Move Editor into Previous Group | ⌃⌘← (Windows, linux Ctrl+Alt+Left) | workbench.action.moveEditorToPreviousGroup |
File Management
| Command | Key | Command id |
|---|---|---|
| New File | ⌘N (Windows, linux Ctrl+N) | workbench.action.files.newUntitledFile |
| Open File... | ⌘O (Windows, linux Ctrl+O) | workbench.action.files.openFile |
| Save | ⌘S (Windows, linux Ctrl+S) | workbench.action.files.save |
| Save All | ⌥⌘S (Windows Ctrl+K S, linux ) | saveAll |
| Save As... | ⇧⌘S (Windows, linux Ctrl+Shift+S) | workbench.action.files.saveAs |
| Close | ⌘W (Windows Ctrl+F4, linux Ctrl+W) | workbench.action.closeActiveEditor |
| Close Others | ⌥⌘T (Windows, linux ) | workbench.action.closeOtherEditors |
| Close Group | ⌘K W (Windows, linux Ctrl+K W) | workbench.action.closeEditorsInGroup |
| Close Other Groups | workbench.action.closeEditorsInOtherGroups |
|
| Close Group to Left | workbench.action.closeEditorsToTheLeft |
|
| Close Group to Right | workbench.action.closeEditorsToTheRight |
|
| Close All | ⌘K ⌘W (Windows, linux Ctrl+K Ctrl+W) | workbench.action.closeAllEditors |
| Reopen Closed Editor | ⇧⌘T (Windows, linux Ctrl+Shift+T) | workbench.action.reopenClosedEditor |
| Keep Open | ⌘K Enter (Windows, linux Ctrl+K Enter) | workbench.action.keepEditor |
| Copy Path of Active File | ⌘K P (Windows, linux Ctrl+K P) | workbench.action.files.copyPathOfActiveFile |
| Reveal Active File in Windows | ⌘K R (Windows, linux Ctrl+K R) | workbench.action.files.revealActiveFileInWindows |
| Show Opened File in New Window | workbench.action.files.showOpenedFileInNewWindow |
|
| Compare Opened File With | workbench.files.action.compareFileWith |
Display
| Command | Key | Command id |
|---|---|---|
| Toggle Full Screen | ⌃⌘F (Windows, linux F11) | workbench.action.toggleFullScreen |
| Toggle Zen Mode | ⌘K Z (Windows, linux Ctrl+K Z) | workbench.action.toggleZenMode |
| Leave Zen Mode | Escape Escape | workbench.action.exitZenMode |
| Zoom in | ⌘= (Windows, linux Ctrl+=) | workbench.action.zoomIn |
| Zoom out | ⌘- (Windows, linux Ctrl+-) | workbench.action.zoomOut |
| Reset Zoom | ⌘Numpad0 (Windows, linux Ctrl+Numpad0) | workbench.action.zoomReset |
| Toggle Sidebar Visibility | ⌘B (Windows, linux Ctrl+B) | workbench.action.toggleSidebarVisibility |
| Show Explorer / Toggle Focus | ⇧⌘E (Windows, linux Ctrl+Shift+E) | workbench.view.explorer |
| Show Search | ⇧⌘F (Windows, linux Ctrl+Shift+F) | workbench.view.search |
| Show Source Control | ⌃⇧G (Windows, linux Ctrl+Shift+G) | workbench.view.scm |
| Show Run | ⇧⌘D (Windows, linux Ctrl+Shift+D) | workbench.view.debug |
| Show Extensions | ⇧⌘X (Windows, linux Ctrl+Shift+X) | workbench.view.extensions |
| Show Output | ⇧⌘U (Windows Ctrl+Shift+U, linux Ctrl+K Ctrl+H) | workbench.action.output.toggleOutput |
| Quick Open View | ⌃Q (Windows Ctrl+Q, linux ) | workbench.action.quickOpenView |
| Open New Command Prompt | ⇧⌘C (Windows, linux Ctrl+Shift+C) | workbench.action.terminal.openNativeConsole |
| Toggle Markdown Preview | ⇧⌘V (Windows, linux Ctrl+Shift+V) | markdown.showPreview |
| Open Preview to the Side | ⌘K V (Windows, linux Ctrl+K V) | markdown.showPreviewToSide |
| Toggle Integrated Terminal | ⌃` (Windows, linux Ctrl+`) | workbench.action.terminal.toggleTerminal |
Search
| Command | Key | Command id |
|---|---|---|
| Show Search | ⇧⌘F (Windows, linux Ctrl+Shift+F) | workbench.view.search |
| Replace in Files | ⇧⌘H (Windows, linux Ctrl+Shift+H) | workbench.action.replaceInFiles |
| Toggle Match Case | ⌥⌘C (Windows, linux Alt+C) | toggleSearchCaseSensitive |
| Toggle Match Whole Word | ⌥⌘W (Windows, linux Alt+W) | toggleSearchWholeWord |
| Toggle Use Regular Expression | ⌥⌘R (Windows, linux Alt+R) | toggleSearchRegex |
| Toggle Search Details | ⇧⌘J (Windows, linux Ctrl+Shift+J) | workbench.action.search.toggleQueryDetails |
| Focus Next Search Result | F4 | search.action.focusNextSearchResult |
| Focus Previous Search Result | ⇧F4 (Windows, linux Shift+F4) | search.action.focusPreviousSearchResult |
| Show Next Search Term | ↓ (Windows, linux Down) | history.showNext |
| Show Previous Search Term | ↑ (Windows, linux Up) | history.showPrevious |
Search Editor
| Command | Key | Command id |
|---|---|---|
| Open Results In Editor | ⌘Enter (Windows, linux Alt+Enter) | search.action.openInEditor |
| Focus Search Editor Input | Escape | search.action.focusQueryEditorWidget |
| Search Again | ⇧⌘R (Windows, linux Ctrl+Shift+R) | rerunSearchEditorSearch |
| Delete File Results | ⇧⌘Backspace (Windows, linux Ctrl+Shift+Backspace) | search.searchEditor.action.deleteFileResults |
Preferences
| Command | Key | Command id |
|---|---|---|
| Open Settings | ⌘, (Windows, linux Ctrl+,) | workbench.action.openSettings |
| Open Workspace Settings | workbench.action.openWorkspaceSettings |
|
| Open Keyboard Shortcuts | ⌘K ⌘S (Windows, linux Ctrl+K Ctrl+S) | workbench.action.openGlobalKeybindings |
| Open User Snippets | workbench.action.openSnippets |
|
| Select Color Theme | ⌘K ⌘T (Windows, linux Ctrl+K Ctrl+T) | workbench.action.selectTheme |
| Configure Display Language | workbench.action.configureLocale |
Debug
| Command | Key | Command id |
|---|---|---|
| Toggle Breakpoint | F9 | editor.debug.action.toggleBreakpoint |
| Start | F5 | workbench.action.debug.start |
| Continue | F5 | workbench.action.debug.continue |
| Start (without debugging) | ⌃F5 (Windows, linux Ctrl+F5) | workbench.action.debug.run |
| Pause | F6 | workbench.action.debug.pause |
| Step Into | F11 | workbench.action.debug.stepInto |
Tasks
| Command | Key | Command id |
|---|---|---|
| Run Build Task | ⇧⌘B (Windows, linux Ctrl+Shift+B) | workbench.action.tasks.build |
| Run Test Task | workbench.action.tasks.test |
Extensions
| Command | Key | Command id |
|---|---|---|
| Install Extension | workbench.extensions.action.installExtension |
|
| Show Installed Extensions | workbench.extensions.action.showInstalledExtensions |
|
| Show Outdated Extensions | workbench.extensions.action.listOutdatedExtensions |
|
| Show Recommended Extensions | workbench.extensions.action.showRecommendedExtensions |
|
| Show Popular Extensions | workbench.extensions.action.showPopularExtensions |
|
| Update All Extensions | workbench.extensions.action.updateAllExtensions |