Visual Studio Code Keyboard Shortcuts

Editor, search, terminal and debugging shortcuts. Every item below is clearly marked as a shortcut, command, or syntax reference.

Most Useful Visual Studio Code Keyboard Shortcuts

Visual Studio CodeShortcut

Command Palette

Windows
Ctrl+Shift+P

Opens the Command Palette to run any command.

Learn More
Visual Studio CodeShortcut

Quick Open File

Windows
Ctrl+P

Opens the file picker to jump to any file by name.

Learn More
Visual Studio CodeShortcut

Save File

Windows
Ctrl+S

Saves the current file.

Learn More
Visual Studio CodeShortcut

Find

Windows
Ctrl+F

Finds text in the current file.

Learn More
Visual Studio CodeShortcut

Find in Files

Windows
Ctrl+Shift+F

Searches across all files in the workspace.

Learn More
Visual Studio CodeShortcut

Format Document

Windows
Shift+Alt+F

Auto-formats the whole file.

Learn More
Visual Studio CodeShortcut

Toggle Line Comment

Windows
Ctrl+/

Comments or uncomments the current line.

Learn More
Visual Studio CodeShortcut

Toggle Terminal

Windows
Ctrl+`

Shows or hides the integrated terminal.

Learn More

More Visual Studio Code Keyboard Shortcuts

Visual Studio Code Shortcuts for Mac

Entries with recorded Mac keys are listed below. Official source links are on each reference page.

TaskTypeShortcut
Command PaletteShortcutCmd+Shift+P
Quick Open FileShortcutCmd+P
Save FileShortcutCmd+S
FindShortcutCmd+F
Find in FilesShortcutCmd+Shift+F
Format DocumentShortcutShift+Option+F
Toggle Line CommentShortcutCmd+/
Toggle TerminalShortcutCtrl+`
New FileShortcutCmd+N
ReplaceShortcutCmd+Option+F
Go to DefinitionShortcutF12
Rename SymbolShortcutF2
Duplicate LineShortcutShift+Option+Down
Move Line Up or DownShortcutOption+Up/Down
Add Cursor to Next MatchShortcutCmd+D
Reopen Closed EditorShortcutCmd+Shift+T
Go to SymbolShortcutCmd+Shift+O
Delete LineShortcutCmd+Shift+K
Select All OccurrencesShortcutCmd+Shift+L
Toggle SidebarShortcutCmd+B
Quick FixShortcutCmd+.
New WindowShortcutCmd+Shift+N
Save AllShortcutCmd+Option+S
Close EditorShortcutCmd+W
Replace in FilesShortcutCmd+Shift+Option+F
Go to LineShortcutCtrl+G
Peek DefinitionShortcutOption+F12
Find All ReferencesShortcutShift+F12
Toggle Block CommentShortcutShift+Option+A
Insert Line BelowShortcutCmd+Enter
Jump to Matching BracketShortcutCmd+Shift+\
Add Cursor BelowShortcutCmd+Option+Down
Split EditorShortcutCmd+\
Zen ModeShortcutCmd+K then Z

Frequently Asked Questions

Which Visual Studio Code keyboard shortcuts are included?

Examples in this reference include Command Palette (Ctrl + Shift + P), Quick Open File (Ctrl + P), Save File (Ctrl + S), Find (Ctrl + F), Find in Files (Ctrl + Shift + F).

Do Visual Studio Code shortcuts work on a Mac?

Mac key values are listed for 34 of the 34 entries. Use the value shown for the specific action; do not assume Ctrl can be replaced with Cmd. Each reference page links its official source.

What if a Visual Studio Code task has no keyboard shortcut?

Some reference pages include a menu alternative. When no equivalent is documented here, consult the linked official help rather than assuming a key combination.