are.dev
My Favorite VS Code Shortcuts for macOS

My Favorite VS Code Shortcuts for macOS

My collection of Visual Studio Code shortcuts to boost productivity.

Visual Studio Code (VS Code) has become my go-to code editor due to its versatility, extensive extension ecosystem, and intuitive interface. Over time, I have explored various features and discovered that mastering keyboard shortcuts significantly boosts my productivity.

I have used VS Code with different operating systems but primarily on macOS. While the editor allows for customizing key bindings, I prefer to stick to the default shortcuts as they are well-thought-out and efficient.

In this post, I want to share a curated list of my favorite VS Code shortcuts — the ones I rely on every day. Whether you’re a beginner aiming to streamline your workflow or an experienced developer looking to pick up a few new tricks, I hope you’ll find this collection useful.

Basic Editing

  • ⌘A — Select all
  • ⌘X — Cut
  • ⌘C — Copy
  • ⌘V — Paste
  • ⌘Z — Undo
  • ⌘⇧Z — Redo

File and Navigation

  • ⌘P — Open file by search
  • ⌘K ⌘W — Close all tabs
  • ⌘B — Toggle sidebar
  • ⌘⌥B — Toggle secondary sidebar
  • ⌘J — Toggle bottom panel
  • ⌘⌃→ — Move focus to right editor group
  • ⌘⌃← — Move focus to left editor group
  • ⌘⌥→ - Move focus to next editor group
  • ⌘⌥← - Move focus to previous editor group

Command Palette

  • ⌘⇧P — Open command palette
  • ⌘K ⌘S — Open keyboard shortcuts

Code Editing

  • ⌘L — Select line
  • ⌘D — Select next occurrence
  • ⌘⇧L — Select all occurrences
  • ⌘F — Search
  • ⌘⇧F — Search in all files
  • ⌘G — Go to next occurrence
  • ⌘⇧G — Go to previous occurrence
  • ⌘⇧K — Delete line
  • ⌥⇧↑ — Duplicate line above
  • ⌥⇧↓ — Duplicate line below
  • ⌥↑ — Move line up
  • ⌥↓ — Move line down

Multi-Cursor Editing

  • ⌘⌥↑ — Add cursor above
  • ⌘⌥↓ — Add cursor below

Scrolling and Cursor Movement

  • ⌘↑ — Scroll up
  • ⌘↓ — Scroll down
  • ⌘→ — Move cursor to end of line
  • ⌘← — Move cursor to start of line
  • ⌥→ — Move cursor to end of word
  • ⌥← — Move cursor to start of word

Selection

  • ⌘⇧↑ — Select from cursor to start of file
  • ⌘⇧↓ — Select from cursor to end of file
  • ⌘⇧→ — Select from cursor to end of line
  • ⌘⇧← — Select from cursor to start of line

Commenting

  • ⌘K ⌘C — Comment a line or all selected lines
  • ⌘K ⌘U — Uncomment a line or all selected lines