Updated March 2026 Official Windows & macOS Reference

Visual Studio Code (VS Code) Keyboard Shortcuts Cheat Sheet

Complete official reference guide for line editing, multi-cursor, navigation, file management, and terminal hotkeys.

Mastering Visual Studio Code Productivity

Software developers and DevOps engineers using Visual Studio Code and Cursor AI achieve peak velocity by staying on the keyboard. This official reference sheet categorizes all 80+ essential VS Code hotkeys for Windows and macOS.

General

  • Show Command Palette:
    Ctrl+Shift+P, F1 (Mac: โŒ˜+Shift+P, F1)
  • Quick Open, Go to File...:
    Ctrl+P (Mac: โŒ˜+P)
  • New window/instance:
    Ctrl+Shift+N (Mac: โŒ˜+Shift+N)
  • Close window/instance:
    Ctrl+Shift+W (Mac: โŒ˜+Shift+W)
  • User Settings:
    Ctrl+, (Mac: โŒ˜+,)
  • Keyboard Shortcuts:
    Ctrl+K Ctrl+S (Mac: โŒ˜+K โŒ˜+S)

Basic editing

  • Cut line (empty selection):
    Ctrl+X (Mac: โŒ˜+X)
  • Copy line (empty selection):
    Ctrl+C (Mac: โŒ˜+C)
  • Move line up/down:
    Alt+Up/Down (Mac: Opt+Up/Down)
  • Copy line up/down:
    Shift+Alt+Down/Up (Mac: Shift+Opt+Down/Up)
  • Delete line:
    Ctrl+Shift+K (Mac: โŒ˜+Shift+K)
  • Insert line below:
    Ctrl+Enter (Mac: โŒ˜+Enter)
  • Insert line above:
    Ctrl+Shift+Enter (Mac: โŒ˜+Shift+Enter)
  • Jump to matching bracket:
    Ctrl+Shift+\ (Mac: โŒ˜+Shift+\)
  • Indent/outdent line:
    Ctrl+] / [ (Mac: โŒ˜+] / [)
  • Go to beginning/end of line:
    Home / End (Mac: Home / End)
  • Go to beginning of file:
    Ctrl+Home (Mac: โŒ˜+Up)
  • Go to end of file:
    Ctrl+End (Mac: โŒ˜+Down)
  • Scroll line up/down:
    Ctrl+Up/Down (Mac: โŒ˜+Up/Down)
  • Scroll page up/down:
    Alt+PgUp/PgDn (Mac: Opt+PgUp/PgDn)
  • Fold (collapse) region:
    Ctrl+Shift+[ (Mac: โŒ˜+Option+[)
  • Unfold (uncollapse) region:
    Ctrl+Shift+] (Mac: โŒ˜+Option+])
  • Fold (collapse) all subregions:
    Ctrl+K Ctrl+[ (Mac: โŒ˜+K โŒ˜+[)
  • Unfold (uncollapse) all subregions:
    Ctrl+K Ctrl+] (Mac: โŒ˜+K โŒ˜+])
  • Fold (collapse) all regions:
    Ctrl+K Ctrl+0 (Mac: โŒ˜+K โŒ˜+0)
  • Unfold (uncollapse) all regions:
    Ctrl+K Ctrl+J (Mac: โŒ˜+K โŒ˜+J)
  • Add line comment:
    Ctrl+K Ctrl+C (Mac: โŒ˜+K โŒ˜+C)
  • Remove line comment:
    Ctrl+K Ctrl+U (Mac: โŒ˜+K โŒ˜+U)
  • Toggle line comment:
    Ctrl+/ (Mac: โŒ˜+/)
  • Toggle block comment:
    Shift+Alt+A (Mac: Shift+Option+A)
  • Toggle word wrap:
    Alt+Z (Mac: Option+Z)

Navigation

  • Show all Symbols:
    Ctrl+T (Mac: โŒ˜+T)
  • Go to Line...:
    Ctrl+G (Mac: Ctrl+G)
  • Go to File...:
    Ctrl+P (Mac: โŒ˜+P)
  • Go to Symbol...:
    Ctrl+Shift+O (Mac: โŒ˜+Shift+O)
  • Show Problems panel:
    Ctrl+Shift+M (Mac: โŒ˜+Shift+M)
  • Go to next error or warning:
    F8 (Mac: F8)
  • Go to previous error or warning:
    Shift+F8 (Mac: Shift+F8)
  • Navigate editor group history:
    Ctrl+Shift+Tab (Mac: Ctrl+Shift+Tab)
  • Go back / forward:
    Alt+Left/Right (Mac: Ctrl+- / Ctrl+Shift+-)
  • Toggle Tab moves focus:
    Ctrl+M (Mac: Ctrl+M)

Search and replace

  • Find:
    Ctrl+F (Mac: โŒ˜+F)
  • Replace:
    Ctrl+H (Mac: โŒ˜+Option+F)
  • Find next/previous:
    F3 / Shift+F3 (Mac: โŒ˜+G / โŒ˜+Shift+G)
  • Select all occurrences of Find match:
    Alt+Enter (Mac: Option+Enter)
  • Add selection to next Find match:
    Ctrl+D (Mac: โŒ˜+D)
  • Move last selection to next Find match:
    Ctrl+K Ctrl+D (Mac: โŒ˜+K โŒ˜+D)
  • Toggle case-sensitive / regex / whole word:
    Alt+C / R / W (Mac: Option+C / R / W)

Multi-cursor and selection

  • Insert cursor:
    Alt+Click (Mac: Option+Click)
  • Insert cursor above / below:
    Ctrl+Alt+Up/Down (Mac: โŒ˜+Option+Up/Down)
  • Undo last cursor operation:
    Ctrl+U (Mac: โŒ˜+U)
  • Insert cursor at end of each line selected:
    Shift+Alt+I (Mac: Shift+Option+I)
  • Select current line:
    Ctrl+L (Mac: โŒ˜+L)
  • Select all occurrences of current selection:
    Ctrl+Shift+L (Mac: โŒ˜+Shift+L)
  • Select all occurrences of current word:
    Ctrl+F2 (Mac: โŒ˜+F2)
  • Expand selection:
    Shift+Alt+Right (Mac: Control+Shift+Command+Right)
  • Shrink selection:
    Shift+Alt+Left (Mac: Control+Shift+Command+Left)
  • Column (box) selection:
    Shift+Alt + drag mouse (Mac: Shift+Option + drag mouse)
  • Column (box) selection:
    Ctrl+Shift+Alt+Arrows (Mac: Cmd+Shift+Option+Arrows)
  • Column (box) selection page up/down:
    Ctrl+Shift+Alt+PgUp/PgDn (Mac: Cmd+Shift+Opt+PgUp/PgDn)

Rich languages editing

  • Trigger suggestion:
    Ctrl+Space, Ctrl+I (Mac: Ctrl+Space, Ctrl+I)
  • Trigger parameter hints:
    Ctrl+Shift+Space (Mac: โŒ˜+Shift+Space)
  • Format document:
    Shift+Alt+F (Mac: Shift+Option+F)
  • Format selection:
    Ctrl+K Ctrl+F (Mac: โŒ˜+K โŒ˜+F)
  • Go to Definition:
    F12 (Mac: F12)
  • Peek Definition:
    Alt+F12 (Mac: Option+F12)
  • Open Definition to the side:
    Ctrl+K F12 (Mac: โŒ˜+K F12)
  • Quick Fix:
    Ctrl+. (Mac: โŒ˜+.)
  • Show References:
    Shift+F12 (Mac: Shift+F12)
  • Rename Symbol:
    F2 (Mac: F2)
  • Trim trailing whitespace:
    Ctrl+K Ctrl+X (Mac: โŒ˜+K โŒ˜+X)
  • Change file language:
    Ctrl+K M (Mac: โŒ˜+K M)

Editor management

  • Close editor:
    Ctrl+F4, Ctrl+W (Mac: โŒ˜+W)
  • Close folder:
    Ctrl+K F (Mac: โŒ˜+K F)
  • Split editor:
    Ctrl+\ (Mac: โŒ˜+\)
  • Focus into 1st, 2nd or 3rd editor group:
    Ctrl+1 / 2 / 3 (Mac: โŒ˜+1 / 2 / 3)
  • Focus into previous/next editor group:
    Ctrl+K Ctrl+Left/Right (Mac: โŒ˜+K โŒ˜+Left/Right)
  • Move editor left/right:
    Ctrl+Shift+PgUp/PgDn (Mac: โŒ˜+Shift+PgUp/PgDn)
  • Move active editor group:
    Ctrl+K Left/Right (Mac: โŒ˜+K Left/Right)

File management

  • New File:
    Ctrl+N (Mac: โŒ˜+N)
  • Open File...:
    Ctrl+O (Mac: โŒ˜+O)
  • Save:
    Ctrl+S (Mac: โŒ˜+S)
  • Save As...:
    Ctrl+Shift+S (Mac: โŒ˜+Shift+S)
  • Save All:
    Ctrl+K S (Mac: โŒ˜+K S)
  • Close:
    Ctrl+F4 (Mac: โŒ˜+W)
  • Close All:
    Ctrl+K Ctrl+W (Mac: โŒ˜+K โŒ˜+W)
  • Reopen closed editor:
    Ctrl+Shift+T (Mac: โŒ˜+Shift+T)
  • Keep preview mode editor open:
    Ctrl+K Enter (Mac: โŒ˜+K Enter)
  • Open next editor:
    Ctrl+Tab (Mac: Ctrl+Tab)
  • Open previous editor:
    Ctrl+Shift+Tab (Mac: Ctrl+Shift+Tab)
  • Copy path of active file:
    Ctrl+K P (Mac: โŒ˜+K P)
  • Reveal active file in Explorer / Finder:
    Ctrl+K R (Mac: Option+Command+R)
  • Show active file in new window/instance:
    Ctrl+K O (Mac: โŒ˜+K O)

Display

  • Toggle full screen:
    F11 (Mac: Control+Command+F)
  • Toggle editor layout (horizontal/vertical):
    Shift+Alt+0 (Mac: Option+Command+0)
  • Zoom in/out:
    Ctrl+ = / - (Mac: โŒ˜+ = / -)
  • Toggle Sidebar visibility:
    Ctrl+B (Mac: โŒ˜+B)
  • Show Explorer / Toggle focus:
    Ctrl+Shift+E (Mac: โŒ˜+Shift+E)
  • Show Search:
    Ctrl+Shift+F (Mac: โŒ˜+Shift+F)
  • Show Source Control:
    Ctrl+Shift+G (Mac: โŒ˜+Shift+G)
  • Show Debug:
    Ctrl+Shift+D (Mac: โŒ˜+Shift+D)
  • Show Extensions:
    Ctrl+Shift+X (Mac: โŒ˜+Shift+X)
  • Replace in files:
    Ctrl+Shift+H (Mac: โŒ˜+Shift+H)
  • Toggle Search details:
    Ctrl+Shift+J (Mac: โŒ˜+Shift+J)
  • Show Output panel:
    Ctrl+Shift+U (Mac: โŒ˜+Shift+U)
  • Open Markdown preview:
    Ctrl+Shift+V (Mac: โŒ˜+Shift+V)
  • Open Markdown preview to the side:
    Ctrl+K V (Mac: โŒ˜+K V)
  • Zen Mode (Esc Esc to exit):
    Ctrl+K Z (Mac: โŒ˜+K Z)

Debug

  • Toggle breakpoint:
    F9 (Mac: F9)
  • Start/Continue:
    F5 (Mac: F5)
  • Stop debug session:
    Shift+F5 (Mac: Shift+F5)
  • Step into / Step out:
    F11 / Shift+F11 (Mac: F11 / Shift+F11)
  • Step over:
    F10 (Mac: F10)
  • Show hover:
    Ctrl+K Ctrl+I (Mac: โŒ˜+K โŒ˜+I)

Integrated terminal

  • Show integrated terminal:
    Ctrl+` (Mac: Ctrl+`)
  • Create new terminal:
    Ctrl+Shift+` (Mac: Ctrl+Shift+`)
  • Copy selection:
    Ctrl+C (Mac: โŒ˜+C)
  • Paste into active terminal:
    Ctrl+V (Mac: โŒ˜+V)
  • Scroll terminal up/down:
    Ctrl+Up/Down (Mac: โŒ˜+Up/Down)
  • Scroll terminal page up/down:
    Shift+PgUp/PgDn (Mac: Shift+PgUp/PgDn)
  • Scroll terminal to top/bottom:
    Ctrl+Home/End (Mac: โŒ˜+Home/End)

Frequently Asked Questions (FAQs)

How do I open the Command Palette in VS Code?

Press Ctrl + Shift + P (or โŒ˜ + Shift + P on Mac) or F1. This launches the Command Palette to execute all editor actions and commands.

How do multi-cursors work in VS Code (Ctrl + D)?

Highlight a word or variable name and press Ctrl + D (or โŒ˜ + D). Each press selects the next matching instance in your active file for multi-cursor batch editing.

How do I toggle the integrated terminal?

Press Ctrl + ` (Control + Backtick) to show or hide the integrated terminal panel without leaving your editor workspace.

Explore Related Guides & Tools