コンテンツにスキップ

VS Code Shortcuts

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

General Shortcuts

Windows/Linux macOS Description
Ctrl+Shift+P Cmd+Shift+P Show Command Palette
Ctrl+P Cmd+P Quick Open (Go to File)
Ctrl+Shift+N Cmd+Shift+N New Window
Ctrl+Shift+W Cmd+Shift+W Close Window
Ctrl+N Cmd+N New File
Ctrl+O Cmd+O Open File
Ctrl+S Cmd+S Save
Ctrl+Shift+S Cmd+Shift+S Save As
Ctrl+K S Cmd+K S Save All
Ctrl+W Cmd+W Close File
Ctrl+K Ctrl+W Cmd+K Cmd+W Close All
Ctrl+Z Cmd+Z Undo
Ctrl+Y Cmd+Shift+Z Redo
Windows/Linux macOS Description
Ctrl+G Cmd+G Go to Line
Ctrl+Shift+O Cmd+Shift+O Go to Symbol
Ctrl+T Cmd+T Show All Symbols
F12 F12 Go to Definition
Alt+F12 Option+F12 Peek Definition
Shift+F12 Shift+F12 Show References
Ctrl+K F12 Cmd+K F12 Open Definition to Side
Ctrl+Alt+- Ctrl+Cmd+- Go Back
Ctrl+Shift+- Ctrl+Shift+Cmd+- Go Forward
Ctrl+M Cmd+M Toggle Tab Moves Focus

Editing

Windows/Linux macOS Description
Ctrl+X Cmd+X Cut Line (empty selection)
Ctrl+C Cmd+C Copy Line (empty selection)
Alt+↑/↓ Option+↑/↓ Move Line Up/Down
Shift+Alt+↓/↑ Shift+Option+↓/↑ Copy Line Up/Down
Ctrl+Shift+K Cmd+Shift+K Delete Line
Ctrl+Enter Cmd+Enter Insert Line Below
Ctrl+Shift+Enter Cmd+Shift+Enter Insert Line Above
Ctrl+Shift+\ Cmd+Shift+\ Jump to Matching Bracket
Ctrl+] Cmd+] Indent Line
Ctrl+[ Cmd+[ Outdent Line
Home/End Home/End Go to Beginning/End of Line
Ctrl+Home Cmd+↑ Go to Beginning of File
Ctrl+End Cmd+↓ Go to End of File

Multi-Cursor and Selection

Windows/Linux macOS Description
Alt+Click Option+Click Insert Cursor
Ctrl+Alt+↑/↓ Cmd+Option+↑/↓ Insert Cursor Above/Below
Ctrl+U Cmd+U Undo Last Cursor Operation
Shift+Alt+I Shift+Option+I Insert Cursor at End of Each Line Selected
Ctrl+L Cmd+L Select Current Line
Ctrl+Shift+L Cmd+Shift+L Select All Occurrences of Current Selection
Ctrl+F2 Cmd+F2 Select 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/Linux macOS Description
Ctrl+F Cmd+F Find
Ctrl+H Cmd+Option+F Replace
F3 Cmd+G Find Next
Shift+F3 Cmd+Shift+G Find Previous
Alt+Enter Option+Enter Select All Occurrences of Find Match
Ctrl+D Cmd+D Add Selection to Next Find Match
Ctrl+K Ctrl+D Cmd+K Cmd+D Move Last Selection to Next Find Match
Alt+C/R/W Option+C/R/W Toggle Case-Sensitive/Regex/Whole Word

Rich Languages Editing

Windows/Linux macOS Description
Ctrl+Space Cmd+Space Trigger Suggestion
Ctrl+Shift+Space Cmd+Shift+Space Trigger Parameter Hints
Shift+Alt+F Shift+Option+F Format Document
Ctrl+K Ctrl+F Cmd+K Cmd+F Format Selection
F12 F12 Go to Definition
Alt+F12 Option+F12 Peek Definition
Ctrl+K F12 Cmd+K F12 Open Definition to the Side
Ctrl+. Cmd+. Quick Fix
Shift+F12 Shift+F12 Show References
F2 F2 Rename Symbol
Ctrl+K Ctrl+X Cmd+K Cmd+X Trim Trailing Whitespace
Ctrl+K M Cmd+K M Change File Language

File Management

Windows/Linux macOS Description
Ctrl+Tab Cmd+Tab Open Next
Ctrl+Shift+Tab Cmd+Shift+Tab Open Previous
Ctrl+K P Cmd+K P Copy Path of Active File
Ctrl+K R Cmd+K R Reveal Active File in Explorer
Ctrl+K O Cmd+K O Show Active File in New Window

Display

Windows/Linux macOS Description
F11 Cmd+Ctrl+F Toggle Full Screen
Shift+Alt+0 Shift+Option+0 Toggle Editor Layout (horizontal/vertical)
Ctrl+= Cmd+= Zoom In
Ctrl+- Cmd+- Zoom Out
Ctrl+0 Cmd+0 Reset Zoom
Ctrl+B Cmd+B Toggle Sidebar Visibility
Ctrl+Shift+E Cmd+Shift+E Show Explorer / Toggle Focus
Ctrl+Shift+F Cmd+Shift+F Show Search
Ctrl+Shift+G Cmd+Shift+G Show Source Control
Ctrl+Shift+D Cmd+Shift+D Show Debug
Ctrl+Shift+X Cmd+Shift+X Show Extensions
Ctrl+Shift+H Cmd+Shift+H Replace in Files
Ctrl+Shift+J Cmd+Shift+J Toggle Search Details
Ctrl+Shift+U Cmd+Shift+U Show Output Panel
Ctrl+Shift+V Cmd+Shift+V Open Markdown Preview
Ctrl+K V Cmd+K V Open Markdown Preview to the Side

Debug

Windows/Linux macOS Description
F9 F9 Toggle Breakpoint
F5 F5 Start/Continue
Shift+F5 Shift+F5 Stop
F11 F11 Step Into
Shift+F11 Shift+F11 Step Out
F10 F10 Step Over
Ctrl+K Ctrl+I Cmd+K Cmd+I Show Hover

Integrated Terminal

Windows/Linux macOS Description
Ctrl+``|Cmd+`` Show Integrated Terminal
Ctrl+Shift+``|Cmd+Shift+`` Create New Terminal
Ctrl+C Cmd+C Copy Selection
Ctrl+V Cmd+V Paste into Active Terminal
Ctrl+↑/↓ Cmd+↑/↓ Scroll Up/Down
Shift+PgUp/PgDn Shift+PgUp/PgDn Scroll Page Up/Down
Ctrl+Home/End Cmd+Home/End Scroll to Top/Bottom

Common Workflows

Project Setup

# 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

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

# List installed extensions
code --list-extensions

# Disable all extensions
code --disable-extensions

Workspace Configuration

// .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