Skip to content

VS Code Shortcuts

Comprehensive Visual Studio Code shortcuts and workflows for enhanced productivity across all platforms.

General Shortcuts

Windows/LinuxmacOSDescription
Ctrl+Shift+PCmd+Shift+PShow Command Palette
Ctrl+PCmd+PQuick Open (Go to File)
Ctrl+Shift+NCmd+Shift+NNew Window
Ctrl+Shift+WCmd+Shift+WClose Window
Ctrl+NCmd+NNew File
Ctrl+OCmd+OOpen File
Ctrl+SCmd+SSave
Ctrl+Shift+SCmd+Shift+SSave As
Ctrl+K SCmd+K SSave All
Ctrl+WCmd+WClose File
Ctrl+K Ctrl+WCmd+K Cmd+WClose All
Ctrl+ZCmd+ZUndo
Ctrl+YCmd+Shift+ZRedo
Windows/LinuxmacOSDescription
Ctrl+GCmd+GGo to Line
Ctrl+Shift+OCmd+Shift+OGo to Symbol
Ctrl+TCmd+TShow All Symbols
F12F12Go to Definition
Alt+F12Option+F12Peek Definition
Shift+F12Shift+F12Show References
Ctrl+K F12Cmd+K F12Open Definition to Side
Ctrl+Alt+-Ctrl+Cmd+-Go Back
Ctrl+Shift+-Ctrl+Shift+Cmd+-Go Forward
Ctrl+MCmd+MToggle Tab Moves Focus

Editing

Windows/LinuxmacOSDescription
Ctrl+XCmd+XCut Line (empty selection)
Ctrl+CCmd+CCopy Line (empty selection)
Alt+↑/↓Option+↑/↓Move Line Up/Down
Shift+Alt+↓/↑Shift+Option+↓/↑Copy Line Up/Down
Ctrl+Shift+KCmd+Shift+KDelete Line
Ctrl+EnterCmd+EnterInsert Line Below
Ctrl+Shift+EnterCmd+Shift+EnterInsert Line Above
Ctrl+Shift+\Cmd+Shift+\Jump to Matching Bracket
Ctrl+]Cmd+]Indent Line
Ctrl+[Cmd+[Outdent Line
Home/EndHome/EndGo to Beginning/End of Line
Ctrl+HomeCmd+↑Go to Beginning of File
Ctrl+EndCmd+↓Go to End of File

Multi-Cursor and Selection

Windows/LinuxmacOSDescription
Alt+ClickOption+ClickInsert Cursor
Ctrl+Alt+↑/↓Cmd+Option+↑/↓Insert Cursor Above/Below
Ctrl+UCmd+UUndo Last Cursor Operation
Shift+Alt+IShift+Option+IInsert Cursor at End of Each Line Selected
Ctrl+LCmd+LSelect Current Line
Ctrl+Shift+LCmd+Shift+LSelect All Occurrences of Current Selection
Ctrl+F2Cmd+F2Select All Occurrences of Current Word
Shift+Alt+→Shift+Option+→Expand Selection
Shift+Alt+←Shift+Option+←Shrink Selection
Shift+Alt+(drag mouse)Shift+Option+(drag mouse)Column (box) Selection

Search and Replace

Windows/LinuxmacOSDescription
Ctrl+FCmd+FFind
Ctrl+HCmd+Option+FReplace
F3Cmd+GFind Next
Shift+F3Cmd+Shift+GFind Previous
Alt+EnterOption+EnterSelect All Occurrences of Find Match
Ctrl+DCmd+DAdd Selection to Next Find Match
Ctrl+K Ctrl+DCmd+K Cmd+DMove Last Selection to Next Find Match
Alt+C/R/WOption+C/R/WToggle Case-Sensitive/Regex/Whole Word

Rich Languages Editing

Windows/LinuxmacOSDescription
Ctrl+SpaceCmd+SpaceTrigger Suggestion
Ctrl+Shift+SpaceCmd+Shift+SpaceTrigger Parameter Hints
Shift+Alt+FShift+Option+FFormat Document
Ctrl+K Ctrl+FCmd+K Cmd+FFormat Selection
F12F12Go to Definition
Alt+F12Option+F12Peek Definition
Ctrl+K F12Cmd+K F12Open Definition to the Side
Ctrl+.Cmd+.Quick Fix
Shift+F12Shift+F12Show References
F2F2Rename Symbol
Ctrl+K Ctrl+XCmd+K Cmd+XTrim Trailing Whitespace
Ctrl+K MCmd+K MChange File Language

File Management

Windows/LinuxmacOSDescription
Ctrl+TabCmd+TabOpen Next
Ctrl+Shift+TabCmd+Shift+TabOpen Previous
Ctrl+K PCmd+K PCopy Path of Active File
Ctrl+K RCmd+K RReveal Active File in Explorer
Ctrl+K OCmd+K OShow Active File in New Window

Display

Windows/LinuxmacOSDescription
F11Cmd+Ctrl+FToggle Full Screen
Shift+Alt+0Shift+Option+0Toggle Editor Layout (horizontal/vertical)
Ctrl+=Cmd+=Zoom In
Ctrl+-Cmd+-Zoom Out
Ctrl+0Cmd+0Reset Zoom
Ctrl+BCmd+BToggle Sidebar Visibility
Ctrl+Shift+ECmd+Shift+EShow Explorer / Toggle Focus
Ctrl+Shift+FCmd+Shift+FShow Search
Ctrl+Shift+GCmd+Shift+GShow Source Control
Ctrl+Shift+DCmd+Shift+DShow Debug
Ctrl+Shift+XCmd+Shift+XShow Extensions
Ctrl+Shift+HCmd+Shift+HReplace in Files
Ctrl+Shift+JCmd+Shift+JToggle Search Details
Ctrl+Shift+UCmd+Shift+UShow Output Panel
Ctrl+Shift+VCmd+Shift+VOpen Markdown Preview
Ctrl+K VCmd+K VOpen Markdown Preview to the Side

Debug

Windows/LinuxmacOSDescription
F9F9Toggle Breakpoint
F5F5Start/Continue
Shift+F5Shift+F5Stop
F11F11Step Into
Shift+F11Shift+F11Step Out
F10F10Step Over
Ctrl+K Ctrl+ICmd+K Cmd+IShow Hover

Integrated Terminal

Windows/LinuxmacOSDescription
`Ctrl+```Cmd+``Show Integrated Terminal
`Ctrl+Shift+```Cmd+Shift+``Create New Terminal
Ctrl+CCmd+CCopy Selection
Ctrl+VCmd+VPaste into Active Terminal
Ctrl+↑/↓Cmd+↑/↓Scroll Up/Down
Shift+PgUp/PgDnShift+PgUp/PgDnScroll Page Up/Down
Ctrl+Home/EndCmd+Home/EndScroll to Top/Bottom

Common Workflows

Project Setup

bash
# Open project in VS Code
code .
code /path/to/project

# Open specific file
code filename.js

# Open with specific settings
code --user-data-dir /path/to/settings

Extension Management

bash
# Install extension
code --install-extension ms-python.python

# List installed extensions
code --list-extensions

# Disable all extensions
code --disable-extensions

Workspace Configuration

json
// .vscode/settings.json
{
  "editor.fontSize": 14,
  "editor.tabSize": 2,
  "files.autoSave": "afterDelay",
  "terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe"
}

Best Practices

Productivity Tips

  • Use Command Palette (Ctrl+Shift+P) for quick access to all commands
  • Master multi-cursor editing for bulk changes
  • Utilize IntelliSense for faster coding
  • Set up custom keybindings for frequently used actions
  • Use workspace settings for project-specific configurations

Code Organization

  • Use file explorer (Ctrl+Shift+E) for quick navigation
  • Organize files with proper folder structure
  • Use search (Ctrl+Shift+F) for finding across files
  • Leverage Git integration for version control
  • Use extensions for language-specific features

Debugging Workflow

  • Set breakpoints strategically
  • Use debug console for runtime evaluation
  • Configure launch.json for custom debug scenarios
  • Utilize conditional breakpoints for complex debugging
  • Use integrated terminal for command-line debugging

Performance Optimization

  • Disable unused extensions
  • Use workspace-specific settings
  • Configure file exclusions for large projects
  • Use remote development for resource-intensive projects
  • Optimize settings for your specific workflow