Skip to main content

VS Code Essential Shortcuts Cheat Sheet

· 4 min read
Anand Raja
Senior Software Engineer

⌨️ Critical Keyboard Shortcuts

Multi-Line Editing (Most Important!)

  • Add Cursor Above/Below: Ctrl + Alt + Up/Down (Windows/Linux) | Cmd + Option + Up/Down (Mac)
  • Add Cursor at Mouse Position: Alt + Click (Windows/Linux) | Option + Click (Mac)
  • Select All Occurrences of Current Selection: Ctrl + Shift + L (Windows/Linux) | Cmd + Shift + L (Mac)
  • Select Next Occurrence: Ctrl + D (Windows/Linux) | Cmd + D (Mac)
  • Insert Cursor at End of Each Line Selected: Shift + Alt + I (Windows/Linux) | Shift + Option + I (Mac)
  • Column (Box) Selection: Shift + Alt + Drag (Windows/Linux) | Shift + Option + Drag (Mac)

Power Editing Shortcuts

  • Move Line Up/Down: Alt + Up/Down (Windows/Linux) | Option + Up/Down (Mac)
  • Copy Line Up/Down: Shift + Alt + Up/Down (Windows/Linux) | Shift + Option + Up/Down (Mac)
  • Delete Line: Ctrl + Shift + K (Windows/Linux) | Cmd + Shift + K (Mac)
  • Comment/Uncomment Line: Ctrl + / (Windows/Linux) | Cmd + / (Mac)
  • Comment/Uncomment Block: Shift + Alt + A (Windows/Linux) | Shift + Option + A (Mac)
  • Indent/Outdent Line: Ctrl + ] / Ctrl + [ (Windows/Linux) | Cmd + ] / Cmd + [ (Mac)
  • Open Command Palette: Ctrl + Shift + P (Windows/Linux) | Cmd + Shift + P (Mac)
  • Quick Open File: Ctrl + P (Windows/Linux) | Cmd + P (Mac)
  • Go to Symbol: Ctrl + Shift + O (Windows/Linux) | Cmd + Shift + O (Mac)
  • Go to Line: Ctrl + G (Windows/Linux) | Cmd + G (Mac)
  • Go to Definition: F12 or Ctrl + Click
  • Peek Definition: Alt + F12 (Windows/Linux) | Option + F12 (Mac)
  • Go Back/Forward: Alt + Left/Right (Windows/Linux) | Ctrl + - / Ctrl + Shift + - (Mac)

Search and Replace

  • Find: Ctrl + F (Windows/Linux) | Cmd + F (Mac)
  • Find in Files: Ctrl + Shift + F (Windows/Linux) | Cmd + Shift + F (Mac)
  • Replace: Ctrl + H (Windows/Linux) | Cmd + H (Mac)
  • Replace in Files: Ctrl + Shift + H (Windows/Linux) | Cmd + Shift + H (Mac)

Panel and Sidebar Management

  • Toggle Sidebar: Ctrl + B (Windows/Linux) | Cmd + B (Mac)
  • Toggle Terminal: Ctrl + \`` (Windows/Linux) | Cmd + `` (Mac)
  • Toggle Explorer: Ctrl + Shift + E (Windows/Linux) | Cmd + Shift + E (Mac)
  • Toggle Extensions: Ctrl + Shift + X (Windows/Linux) | Cmd + Shift + X (Mac)
  • Show Problems: Ctrl + Shift + M (Windows/Linux) | Cmd + Shift + M (Mac)

Code Formatting and Intelligence

  • Format Document: Shift + Alt + F (Windows/Linux) | Shift + Option + F (Mac)
  • Format Selection: Ctrl + K, Ctrl + F (Windows/Linux) | Cmd + K, Cmd + F (Mac)
  • Quick Fix: Ctrl + . (Windows/Linux) | Cmd + . (Mac)
  • Trigger Suggestion: Ctrl + Space (Windows/Linux) | Cmd + Space (Mac)
  • Rename Symbol: F2

🖱️ Essential Mouse Shortcuts

Multi-Line Mouse Editing

  • Add Multiple Cursors: Alt + Click (Windows/Linux) | Option + Click (Mac)
  • Column Selection: Shift + Alt + Drag (Windows/Linux) | Shift + Option + Drag (Mac)
  • Select Word: Double-click
  • Select Line: Triple-click
  • Select Paragraph: Quadruple-click
  • Go to Definition: Ctrl + Click (Windows/Linux) | Cmd + Click (Mac)
  • Peek Definition: Alt + Click (Windows/Linux) | Option + Click (Mac)
  • Open Link: Ctrl + Click (Windows/Linux) | Cmd + Click (Mac)

Context Menu Actions

  • Right-click for Context Menu: Includes refactor, format, go to definition options
  • Breadcrumb Navigation: Click on breadcrumbs at top of editor

🚀 Pro Tips

Workflow Combinations

  1. Select word (Ctrl + D) → Add next occurrence (Ctrl + D again) → Multi-edit
  2. Column select (Shift + Alt + Drag) → Type to edit all lines simultaneously
  3. Find (Ctrl + F) → Select all occurrences (Alt + Enter) → Multi-edit

Advanced Multi-Line Techniques

  • Box Selection: Hold Shift + Alt and drag to select rectangular regions
  • Multi-cursor from search: Use Ctrl + F to find, then Alt + Enter to select all matches
  • Cursor at line ends: Select lines, then Shift + Alt + I to place cursors at end of each line

🎯 Memory Aids

Most Used Multi-Line:

  • Ctrl + D - Select next occurrence (repeat to add more)
  • Alt + Click - Add cursor anywhere
  • Ctrl + Alt + Up/Down - Add cursor above/below

Essential Navigation:

  • Ctrl + P - Quick open (most important!)
  • Ctrl + Shift + P - Command palette (second most important!)
  • F12 - Go to definition

Remember: Practice these shortcuts daily to build muscle memory!