Steve Kinney

Visual Studio Code

Some Keyboard Shortcuts for Visual Studio Code

ActionmacOS ShortcutWindows ShortcutDescription
Command PaletteCmd + Shift + PCtrl + Shift + PAccess all commands, settings, and more.
Go to FileCmd + PCtrl + PFuzzy-find and open files.
Search Across FilesCmd + Shift + FCtrl + Shift + FGlobal search in all files/folders.
Toggle TerminalCtrl + `Ctrl + `Show/hide the integrated terminal. (Backtick is the key above Tab.)
Toggle SidebarCmd + BCtrl + BShow/hide the left sidebar (file explorer, etc.).
Navigate BackCtrl + -Alt + Left ArrowGo back to the previous location in code.
Navigate ForwardCtrl + Shift + -Alt + Right ArrowGo forward to the next location in code.

Editing Essentials

ActionmacOS ShortcutWindows ShortcutDescription
Cut Line (no selection needed)Cmd + XCtrl + XCuts the entire line if nothing is selected.
Copy Line (no selection needed)Cmd + CCtrl + CCopies the entire line if nothing is selected.
PasteCmd + VCtrl + VPastes what you last cut or copied.
Duplicate LineShift + Option + ↓Shift + Alt + ↓Clones your current line right below.
Move Line Up/DownOption + ↑/↓Alt + ↑/↓Moves the current line (or selection) up/down.
Select Next OccurrenceCmd + DCtrl + DFinds the next exact match of your current selection and adds a new cursor.
Select All OccurrencesCmd + Shift + LCtrl + Shift + LHighlights all matching words in the file at once (multi-cursor).
Comment/Uncomment LineCmd + /Ctrl + /Toggles a line comment (//) or comments out a selection.
Toggle Block CommentShift + Option + AShift + Alt + AWraps/unwraps the selected text in a block comment.
Add Multiple CursorsOption + Cmd + Up/Down or Option + ClickCtrl + Alt + Up/Down or Alt + ClickAdds multiple cursors for editing in parallel.
Delete Linenot bound by default (suggest Ctrl+Shift+K)Ctrl + Shift + K (default)Deletes the entire current line.
Join Lines(bind manually, e.g. Ctrl+J)(bind manually, e.g. Ctrl+J)Joins the next line to the end of the current line (no line break).

Code Intelligence

ActionmacOS ShortcutWindows ShortcutDescription
Go to DefinitionF12 or Cmd + ClickF12 or Ctrl + ClickJumps to where a symbol (function/variable) is defined.
Peek DefinitionOption + F12Alt + F12Shows the definition in a popup without leaving your file.
Rename SymbolF2F2Renames all instances of a symbol (function, variable, etc.).
Auto-Complete SuggestionsCtrl + SpaceCtrl + SpacePops up intellisense suggestions for context-based completions.

Layout & Formatting

ActionmacOS ShortcutWindows ShortcutDescription
Format DocumentShift + Option + FShift + Alt + FFormats your code (with Prettier/beautifier, etc.).
Toggle Word WrapOption + ZAlt + ZWraps long lines of code onto the next line.
Fold All / Unfold AllCmd + K + 0 / Cmd + K + JCtrl + K + 0 / Ctrl + K + JCollapses or expands all foldable regions in the file.
Split Editor**Cmd + ****Ctrl + **Splits the active editor window into multiple panes.
Focus on Next/Prev Editor GroupCtrl + Cmd + → / ←Ctrl + K Ctrl + → / ←Moves focus between split panes (or use the arrow keys).
Toggle FullscreenCtrl + Cmd + FF11Toggles full screen.
Zen ModeCmd + K ZCtrl + K ZDistraction-free mode.

Last modified on .