Here’s a complete list of shortcuts for coding in Visual Studio Code (VS Code). These shortcuts will help you with navigation, code editing, refactoring, debugging, Git integration, and more.

Visual Studio Code


General Shortcuts

  • Command Palette: Ctrl + Shift + P (Windows/Linux), Cmd + Shift + P (Mac)
  • Quick Open: Ctrl + P (Windows/Linux), Cmd + P (Mac)
  • Open New Window: Ctrl + Shift + N (Windows/Linux), Cmd + Shift + N (Mac)
  • Close Window: Ctrl + Shift + W (Windows/Linux), Cmd + Shift + W (Mac)
  • User Settings: Ctrl + , (Windows/Linux), Cmd + , (Mac)

File Management

  • New File: Ctrl + N (Windows/Linux), Cmd + N (Mac)
  • Open File: Ctrl + O (Windows/Linux), Cmd + O (Mac)
  • Save: Ctrl + S (Windows/Linux), Cmd + S (Mac)
  • Save All: Ctrl + K S (Windows/Linux), Cmd + Option + S (Mac)
  • Close File: Ctrl + W (Windows/Linux), Cmd + W (Mac)
  • Reopen Closed File: Ctrl + Shift + T (Windows/Linux), Cmd + Shift + T (Mac)

Editing Shortcuts

  • Copy Line Up/Down: Shift + Alt + Up/Down Arrow (Windows/Linux), Option + Shift + Up/Down Arrow (Mac)
  • Move Line Up/Down: Alt + Up/Down Arrow (Windows/Linux), Option + Up/Down Arrow (Mac)
  • Duplicate Line: Shift + Alt + Down (Windows/Linux), Cmd + Shift + D (Mac)
  • Delete Line: Ctrl + Shift + K (Windows/Linux), Cmd + Shift + K (Mac)
  • Go to Beginning/End of Line: Home/End (Windows/Linux), Cmd + Left/Right Arrow (Mac)
  • Go to Beginning/End of File: Ctrl + Home/End (Windows/Linux), Cmd + Up/Down Arrow (Mac)
  • Select All: Ctrl + A (Windows/Linux), Cmd + A (Mac)
  • Undo: Ctrl + Z (Windows/Linux), Cmd + Z (Mac)
  • Redo: Ctrl + Y (Windows/Linux), Cmd + Shift + Z (Mac)
  • Find: Ctrl + F (Windows/Linux), Cmd + F (Mac)
  • Replace: Ctrl + H (Windows/Linux), Cmd + Option + F (Mac)

Code Navigation

  • Go to Definition: F12
  • Peek Definition: Alt + F12 (Windows/Linux), Option + F12 (Mac)
  • Go to Declaration: Ctrl + Shift + B
  • Go to Symbol in File: Ctrl + Shift + O (Windows/Linux), Cmd + Shift + O (Mac)
  • Go to Symbol in Workspace: Ctrl + T (Windows/Linux), Cmd + T (Mac)
  • Go to Line: Ctrl + G (Windows/Linux), Cmd + G (Mac)
  • Toggle Comment Line: Ctrl + / (Windows/Linux), Cmd + / (Mac)
  • Block Comment: Shift + Alt + A (Windows/Linux), Cmd + Option + A (Mac)

Code Formatting

  • Format Document: Shift + Alt + F (Windows/Linux), Shift + Option + F (Mac)
  • Format Selection: Ctrl + K Ctrl + F (Windows/Linux), Cmd + K Cmd + F (Mac)

Multiple Cursors & Selections

  • Add Cursor Above/Below: Ctrl + Alt + Up/Down Arrow (Windows/Linux), Cmd + Option + Up/Down Arrow (Mac)
  • Insert Cursor at All Matching: Ctrl + Shift + L (Windows/Linux), Cmd + Shift + L (Mac)
  • Select Next Matching Word: Ctrl + D (Windows/Linux), Cmd + D (Mac)
  • Select All Occurrences of Word: Ctrl + Shift + L (Windows/Linux), Cmd + Shift + L (Mac)
  • Column Selection: Shift + Alt + Click (Windows/Linux), Cmd + Option + Click (Mac)

Refactoring Shortcuts

  • Rename Symbol: F2
  • Quick Fix (Auto-Suggestions): Ctrl + . (Windows/Linux), Cmd + . (Mac)
  • Extract to Method/Variable: Available via Command Palette

Debugging

  • Start/Stop Debugging: F5
  • Step Into: F11
  • Step Out: Shift + F11
  • Step Over: F10
  • Toggle Breakpoint: F9
  • Run to Cursor: Ctrl + F10 (Windows/Linux), Cmd + F10 (Mac)

Integrated Terminal

  • Open Terminal: Ctrl + (Backtick) (Windows/Linux), Cmd + (Mac)
  • Create New Terminal: Ctrl + Shift + (Backtick) (Windows/Linux), Cmd + Shift + (Mac)
  • Toggle Terminal: Ctrl + (Windows/Linux), Cmd + (Mac)

Split Window/Editor

  • Split Editor: Ctrl + \ (Windows/Linux), Cmd + \ (Mac)
  • Switch Between Editors: Ctrl + 1/2/3 (Windows/Linux), Cmd + 1/2/3 (Mac)
  • Close Editor: Ctrl + W (Windows/Linux), Cmd + W (Mac)
  • Focus on Editor Group: Ctrl + K Ctrl + Left/Right Arrow

Git Integration

  • Git: Stage Changes: Ctrl + Shift + G (Windows/Linux), Cmd + Shift + G (Mac)
  • Git: Commit: Available in the Source Control panel
  • Git: Push: Available in the Source Control panel
  • Git: Pull: Available in the Source Control panel

Sidebars and Panels

  • Toggle Sidebar: Ctrl + B (Windows/Linux), Cmd + B (Mac)
  • Focus on Explorer View: Ctrl + Shift + E
  • Focus on Search View: Ctrl + Shift + F
  • Focus on Source Control View: Ctrl + Shift + G
  • Focus on Extensions View: Ctrl + Shift + X

Miscellaneous

  • Toggle Zen Mode: Ctrl + K Z
  • Toggle Full Screen: F11
  • Toggle Word Wrap: Alt + Z
  • Show Problems Panel: Ctrl + Shift + M (Windows/Linux), Cmd + Shift + M (Mac)

This list covers a wide range of shortcuts to boost productivity in VS Code. Learning and using these can significantly speed up your coding and workflow.