My Brain CellsMy Brain Cells
HomeBlogAbout

© 2026 My Brain Cells

XGitHubLinkedIn
VS Code Keyboard Shortcuts Every Developer Should Know

VS Code Keyboard Shortcuts Every Developer Should Know

AS
Anthony Sandesh
Visual Studio Code (VS Code) has become one of the most popular code editors thanks to its powerful features and extensibility. However, mastering VS Code goes beyond installing extensions and tweaking settings — it’s about efficiency. Keyboard shortcuts can dramatically speed up your development workflow, reduce context switching, and keep your hands on the keyboard. This post covers essential VS Code shortcuts every developer should know, organized by categories and tailored for both Windows/Linux and macOS users.

1. General Command Palette

Windows/Linux: Ctrl + Shift + P
macOS: Cmd + Shift + P
  • Why? The Command Palette is your gateway to all VS Code commands. Instead of hunting through menus, press this shortcut and start typing the command you need.

2. File Management

Action
Windows/Linux
macOS
Open File
Ctrl + O
Cmd + O
Save File
Ctrl + S
Cmd + S
Save All
Ctrl + K, S
Cmd + Option + S
Close Editor
Ctrl + W
Cmd + W
Close Folder/Workspace
Ctrl + K F
Cmd + K F

3. Editor Navigation

  • Switch Between Open Editors
    • Windows/Linux: Ctrl + Tab
    • macOS: Cmd + Option + → / ←
  • Go to File...
    • Windows/Linux: Ctrl + P
    • macOS: Cmd + P
  • Go to Symbol in File
    • Windows/Linux: Ctrl + Shift + O
    • macOS: Cmd + Shift + O
  • Go to Definition/Declaration
    • Windows/Linux: F12 or Ctrl + Click
    • macOS: F12 or Cmd + Click

4. Editing & Refactoring

  • Find
    • Windows/Linux: Ctrl + F
    • macOS: Cmd + F
  • Replace
    • Windows/Linux: Ctrl + H
    • macOS: Cmd + Option + F
  • Multi-Cursor Editing
    • Add Cursor Above/Below:
      • Windows/Linux: Ctrl + Alt + ↑ / ↓
      • macOS: Option + Cmd + ↑ / ↓
    • Insert Cursor at End of Each Line Selected:
      • Windows/Linux: Shift + Alt + I
      • macOS: Shift + Option + I
  • Move Line Up/Down
    • Windows/Linux: Alt + ↑ / ↓
    • macOS: Option + ↑ / ↓
  • Toggle Line Comment
    • Windows/Linux: Ctrl + /
    • macOS: Cmd + /
  • Block Comment
    • Windows/Linux: Shift + Alt + A
    • macOS: Shift + Option + A
  • Refactor (Extract Method/Variable)
    • Windows/Linux: Ctrl + Shift + R
    • macOS: Cmd + Shift + R

5. Searching Across Project

  • Search in Files
    • Windows/Linux: Ctrl + Shift + F
    • macOS: Cmd + Shift + F
  • Replace in Files
    • Windows/Linux: Ctrl + Shift + H
    • macOS: Cmd + Shift + H
  • Toggle Search Details (regex, case-sensitive, whole word)
    • Windows/Linux: Alt + R / C / W
    • macOS: Option + Cmd + R / C / W

6. Integrated Terminal

  • Show/Hide Terminal
    • Windows/Linux: Ctrl + `
    • macOS: Cmd + `
  • Create New Terminal
    • Windows/Linux: Ctrl + Shift + ``
    • macOS: Cmd + Shift + ``
  • Run Selected Text in Terminal
    • Windows/Linux: Ctrl + Enter
    • macOS: Cmd + Enter

7. Debugging

  • Toggle Breakpoint
    • Windows/Linux: F9
    • macOS: F9
  • Step Over / Into / Out
    • Windows/Linux: F10 / F11 / Shift + F11
    • macOS: F10 / F11 / Shift + F11
  • Start/Continue Debugging
    • Windows/Linux: F5
    • macOS: F5
  • Open Debug Console
    • Windows/Linux: Ctrl + Shift + Y
    • macOS: Cmd + Shift + Y

8. Git Integration

  • Commit All
    • Windows/Linux: Ctrl + Enter (in Source Control view)
    • macOS: Cmd + Enter
  • Stage Selected Ranges/Hunks
    • Windows/Linux: Ctrl + Shift + K
    • macOS: Cmd + Shift + K
  • Open Git View
    • Windows/Linux: Ctrl + Shift + G
    • macOS: Cmd + Shift + G

9. Tips & Tricks

  • Customize Keybindings: Open keybindings.json via Command Palette for personal preferences.
  • Keyboard Shortcut Reference: Ctrl + K Ctrl + R (Win/Linux) or Cmd + K Cmd + R (macOS) to view and edit all shortcuts.
  • Extensions: Tools like VSCodeVim allow modal editing shortcuts.

Conclusion

Mastering these keyboard shortcuts will make you faster and more productive in VS Code. Start by focusing on a few that address your biggest pain points — whether it’s navigation, editing, debugging, or version control. Over time, you’ll build muscle memory that lets you code without leaving the keyboard.

More posts

Scraping Images from the Web Using Selenium

Scraping Images from the Web Using Selenium

System Design Interview: Design Instagram 📸

Newer

System Design Interview: Design Instagram 📸

Big O Cheat Sheet

Older

Big O Cheat Sheet

On this page

  1. 1. General Command Palette
  2. 2. File Management
  3. 3. Editor Navigation
  4. 4. Editing & Refactoring
  5. 5. Searching Across Project
  6. 6. Integrated Terminal
  7. 7. Debugging
  8. 8. Git Integration
  9. 9. Tips & Tricks
  10. Conclusion