Visual Studio Code Shortcuts Cheat Sheet



This page lists the default command shortcuts for the General profile, which you might have chosen when you installed Visual Studio. No matter which profile you chose, you can identify the shortcut for a command by opening the Options dialog box, expanding the. Download Cheat Sheet on Visual Studio Code Shortcuts. There are many shortcuts that are used in the Visual Studios Code to help its user work fast and more efficiently. What is Visual Studio Code? Visual Studio Code is an application basically designed to carry out work in relation to code.

VSCode cheat sheet of all shortcuts and commands. Ctrl+K Ctrl+S Keyboard Shortcuts Basic editing Ctrl+X Cut line (empty selection) Ctrl+C Copy line (empty selection) Alt+ ↑ / ↓ Move line up/down Shift+Alt + ↓ / ↑ Copy line up/down Ctrl+Shift+K Delete line Ctrl+Enter Insert line below Ctrl+Shift+Enter Insert line above Ctrl+Shift+ Jump to matching bracket. I need to modify Visual Studio 2015 keyboard shortcuts. All cheat sheets I can find, only include the shortcut and the description of what it does. This doesn't help changing the shortcut, because in.

-->

You can navigate in Visual Studio more easily by using the shortcuts in this article. These shortcuts include keyboard and mouse shortcuts as well as text you can enter to help accomplish a task more easily.

For a complete list of command shortcuts, see Default keyboard shortcuts.

Note

This topic applies to Visual Studio on Windows. How to use mac for virtualbox. For Visual Studio for Mac, see Common keyboard shortcuts in Visual Studio for Mac.

Window management

TaskShortcut
Maximize floating windowDouble-click on title bar
Maximize/minimize windowsWin+Up arrow / Win+Down arrow
Redock floating windowCtrl+double-click on title bar
Move/dock floating windowsWin+Left arrow / Win+Right arrow
Close active documentCtrl+F4
Show open file listCtrl+Alt+Down arrow
Show all floating windowsCtrl+Shift+M
Show jump listWin+Alt+N
Start new instanceWin+Shift+N
Switch between windowsWin+N

Search

TaskShortcut
Solution Explorer searchCtrl+;
Place focus in search box in any tool window (except editor)Alt+` when the tool window has focus
Search Visual StudioCtrl+Q
Search box results filter@opt - Options
@cmd - Commands
@mru - Most recently used
@doc - Open documents
Search in Tools OptionsCtrl+E

Find in the editor

TaskShortcut
Quick FindCtrl+F
Quick Find Next ResultEnter
Quick Find Previous ResultShift+Enter
Quick Find Expand Drop DownAlt+Down arrow
Dismiss FindEsc
Quick ReplaceCtrl+H
Quick Replace - Replace NextAlt+R
Quick Replace - Replace AllAlt+A
Find in FilesCtrl+Shift+F
Replace in FilesCtrl+Shift+H

Code editor

TaskShortcut
Go To AllCtrl+T
Go to recent filesCtrl+T,R
Multi-caret multiple insertion pointsCtrl+Alt+click
Multi-caret add matching selectionShift+Alt+Ins
Format DocumentCtrl+K,D
IntelliSense suggestion modeCtrl+Alt+Space (Toggle)
Force show IntelliSenseCtrl+J
Quick ActionsCtrl+.
Snippet pickerCtrl+K,X or ?,Tab (Visual Basic)
Surround WithCtrl+K,S
Show Quick InfoCtrl+K,I
Navigate ToCtrl+,
Navigate highlighted referencesCtrl+Shift+Up (Previous)
Ctrl+Shift+Down (Next)
Editor zoomCtrl+Shift+> (In)
Ctrl+Shift+< (Out)
Block selectionHold Alt and drag mouse
Shift+Alt+Arrow keys
Move line up/downAlt+Up arrow / Alt+Down arrow
Duplicate lineCtrl+E,V
Expand selectionShift+Alt+=
Contract selectionShift+Alt+-
Go To DefinitionF12
Peek DefinitionAlt+F12
Go To Definition stackCtrl+Shift+8 (Back)
Ctrl+Shift+7 (Forward)
Close the Peek Definition windowEsc
Promote the Peek Definition window to a regular document tabCtrl+Alt+Home
Navigate between multiple Peek Definition windowsCtrl+Alt+- and Ctrl+Alt+=
Navigate between multiple Peek resultsF8 and Shift+F8
Toggle between the code editor window and the Peek Definition windowShift+Esc
Go to enclosing blockCtrl+Alt+Up arrow
Go to next/previous issueAlt+PgUp / Alt+PgDn
Contextual navigation menuAlt+`

Toolbars

TaskShortcut
Add buttonsSelect the toolbar overflow button
Find combo in standard toolbarCtrl+D
Find textbox command modeType >
Create new aliasType alias <new alias> <command> in the Command window

Debugging

TaskShortcut
Start debuggingF5
Stop debuggingShift+F5
Restart debuggingCtrl+Shift+F5
Step overF10
Step intoF11
Step outShift+F11
Run to cursorCtrl+F10
Set next statementCtrl+Shift+F10
Set and toggle breakpointF9
Disable breakpointCtrl+F9
Immediate windowCtrl+Alt+I
Immediate window command modeType >
Immediate window - clear bufferType cls
Immediate window - print valueType ?varname

See also

This is my personal cheat sheet for Microsoft Visual Studio Code (VS Code). Mainly, this is to record little commands and things that I am constantly forgetting (especially unique ones related to the unique plugins I use).

Keyboard shortcuts for Windows

General

Shortcuts
ActionKey(s)
Show Command PaletteCTRL + SHIFT + P, F1
Quick Open, Go to File…CTRL + P
New window/instanceCTRL + SHIFT + N
Close window/instanceCTRL + SHIFT + W
User SettingsCTRL + ,
Keyboard ShortcutsCTRL + KCTRL + S

Basic editing

ActionKey(s)
Cut line (empty selection)Ctrl + X
Copy line (empty selection)Ctrl + C
Move line up/downAlt + /
Copy line up/downShift + Alt + /
Delete lineCtrl + Shift + K
Insert line belowCtrl + Enter
Insert line aboveCtrl + Shift + Enter
Jump to matching bracketCtrl + Shift +
Indent/outdent lineCtrl + ] / [
Go to beginning/end of lineHome / End
Go to beginning of fileCtrl + Home
Go to end of fileCtrl + End
Scroll line up/downCtrl + /
Scroll page up/downAlt + PgUp / PgDn
Fold (collapse) regionCtrl + Shift + [
Unfold (uncollapse) regionCtrl + Shift + ]
Fold (collapse) all subregionsCtrl + KCtrl + [
Unfold (uncollapse) all subregionsCtrl + KCtrl + ]
Fold (collapse) all regionsCtrl + KCtrl + 0
Unfold (uncollapse) all regionsCtrl + KCtrl + J
Add line commentCtrl + KCtrl + C
Remove line commentCtrl + KCtrl + U
Toggle line commentCtrl + /
Toggle block commentShift + Alt + A
Toggle word wrapAlt + Z

Navigation

ActionKey(s)
Show all SymbolsCTRL + T
Go to Line..CTRL + G
Go to File..CTRL + P
Go to Symbol..CTRL + SHIFT + O
Show Problems panelCTRL + SHIFT + M
Go to next error or warningF8
Go to previous error or warningSHIFT + F8
Navigate editor group historyCTRL + SHIFT + TAB
Go back / forwardALT + /
Toggle Tab moves focusCTRL + M

Search and replace

ActionKey(s)
FindCTRL + F
ReplaceCTRL + H
Find next/previousF3 / SHIFT + F3
Select all occurences of Find matchALT + ENTER
Add selection to next Find matchCTRL + D
Move last selection to next Find matchCTRL + K CTRL + D
Toggle case-sensitive / regex / whole wordALT + C / R / W

Multi-cursor and selection

ActionKey(s)
Insert cursorALT + Click
Insert cursor above / belowCTRL + ALT + /
Undo last cursor operationCTRL + U
Insert cursor at end of each line selectedSHIFT + ALT + I
Select current lineCTRL + L
Select all occurrences of current selectionCTRL + SHIFT + L
Select all occurrences of current wordCTRL + F2
Expand selectionSHIFT + ALT +
Shrink selectionSHIFT + ALT +
Column (box) selectionSHIFT + ALT + (drag mouse)
Column (box) selectionCTRL + SHIFT + ALT + (arrow key)
Column (box) selection page up/downCTRL + SHIFT + ALT + PgUp / PgDn

Rich languages editing

Visual Studio Code Shortcuts Cheat Sheet Mac

Sheet
ActionKey(s)
Trigger suggestionCTRL + SPACE
Trigger parameter hintsCTRL + SHIFT + SPACE
Format documentSHIFT + ALT + F
Format selectionCTRL + K CTRL + F
Go to DefinitionF12
Peek DefinitionALT + F12
Open Definition to the sideCTRL + KF12
Quick FixCTRL + .
Show ReferencesSHIFT + F12
Rename SymbolF2
Trim trailing whitespaceCTRL + KCTRL + X
Change file languageCTRL + KM

Editor management

ActionKey(s)
Close editorCTRL + F4, CTRL +
Close folderCTRL + KF
Split editorCTRL +
Focus into 1st, 2nd or 3rd editor groupCTRL + 1 / 2 / 3
Focus into previous/next editor groupCTRL + K CTRL + /
Move editor left/rightCTRL + SHIFT + PgUp / PgDn
Move active editor groupCTRL + K /

File management

ActionKey(s)
New FileCTRL + N
Open File..CTRL + O
SaveCTRL + S
Save As..CTRL + SHIFT + S
Save AllCTRL + K S
CloseCTRL + F4
Close AllCTRL + KCTRL + W
Reopen closed editorCTRL + SHIFT + T
Enter Keep preview mode editor openCTRL + K
Open nextCTRL + Tab
Open previousCTRL + SHIFT + Tab
Copy path of active fileCTRL + K P
Reveal active file in ExplorerCTRL + K R
Show active file in new window/instanceCTRL + K O

Display

ActionKey(s)
Toggle full screenF11
Toggle editor layout (horizontal/vertical)SHIFT + ALT + 0
Zoom in/outCTRL + = / -
Toggle Sidebar visibilityCTRL + B
Show Explorer / Toggle focusCTRL + SHIFT + E
Show SearchCTRL + SHIFT + F
Show Source ControlCTRL + SHIFT + G
Show DebugCTRL + SHIFT + D
Show ExtensionsCTRL + SHIFT + X
Replace in filesCTRL + SHIFT + H
Toggle Search detailsCTRL + SHIFT + J
Show Output panelCTRL + SHIFT + U
Open Markdown previewCTRL + SHIFT + V
Open Markdown preview to the sideCTRL + K V
Zen Mode (Esc Esc to exit)CTRL + K Z

Vs Code Shortcuts Pdf

Debug

ActionKey(s)
Toggle breakpointF9
Start/ContinueF5
StopSHIFT + F5
Step into/outF11 / SHIFT + F11
Step overF10
Show hoverCTRL + K CTRL + I

Integrated terminal

ActionKey(s)
Show integrated terminalCTRL + `
Create new terminalCTRL + SHIFT + `
Copy selectionCTRL + C
Paste into active terminalCTRL + V
Scroll up/downCTRL + ↑ / ↓
Scroll page up/downSHIFT + PgUp / PgDn
Scroll to top/bottomCTRL + Home / End

For other operating systems’ keyboard shortcuts and additional information, see Key Bindings for Visual Studio Code.

Preference settings

Following is NOT an exhaustive list of all preference settings that are available. There are more, but these are just the ones I have so far found useful.

To access settings, go to File > Preferences > Settings, or press CTRL + ,

SettingDescription
editor.minimap.enabledControls whether the minimap is shown.
editor.renderControlCharactersControls whether the editor should render control characters.
editor.renderWhitespaceControls whether the editor should render whitespace characters.
explorer.compactFoldersControls whether the explorer should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element. Useful for Java package structures, for example.
html.autoClosingTagsEnable/disable autoclosing of HTML tags.
javascript.updateImportsOnFileMove.enabledEnable/disable automatic updating of import paths when you rename or move a file in VS Code. Requires using TypeScript 2.9 or newer in the workspace.
window.zoomLevelAdjust the zoom level of the window. The original size is 0 and each increment above (e.g. 1) or below (e.g. -1) represents zooming 20% larger or smaller. You can also enter decimals to adjust the zoom level with a finer granularity.
workbench.tree.indentControls tree indentation in pixels.
workbench.tree.renderIndentGuidesControls whether the tree should render indent guides.
Cheat

Plugins

HTML Tag Wrap

Plugin dependency: htmltagwrap

Wraps selected code with HTML tags.

Usage

  • Select one or more blocks of text or strings of text.
  • Press Alt + W or Option + W for Mac.
  • Type the tag name you want.

By default, pressing spacebar will deselect the closing tags, so you can add attributes to the opening tags (you can turn this feature off, see below). If nothing is selected when you run htmltagwrap, it will add an opening and closing tag at the cursor position.

NOTE: This extension works best in files that either use tabs or spaces for indentation. It may not work as well with mixed tabs/spaces.





Comments are closed.