DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 968,873 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for VS Code Shortcuts to Boost Your Productivity
Thomas Lombart
Thomas Lombart

Posted on • Updated on

VS Code Shortcuts to Boost Your Productivity

Did you ever wanted to write code like a pro? To move chunks of code back and forth easily? Access whatever you want in the blink of an eye? Well, I did.

All the coding courses I took were recorded by instructors who seemed to know their code editor by heart. Seeing them slamming their keyboard and manipulating their code like pros made me think it was just ridiculous. That's when I decided to learn all the essential shortcuts of my favorite code editor: VS Code.

You'll find below all of the different shortcuts I use:

  • Open the command palette: ⇧ + ⌘ + P or Ctrl + Shift + P
  • Open keyboard shortcuts: ⌘ + K ⌘ + S or Ctrl + K Ctrl + S
  • Open user settings: ⌘ + , or Ctrl + ,

Editing

  • Undo: ⌘ + Z or Ctrl + Z
  • Redo: ⇧ + ⌘ + Z or Ctrl + Shift + Z
  • Remove one word: βŒ₯ + ⌫ or Ctrl + Backspace
  • Cut line: ⌘ + X or Ctrl + X
  • Copy line: ⌘ + C or Ctrl + C
  • Paste line: ⌘ + V or Ctrl + V
  • Delete line: ⇧ + ⌘ + K or Ctrl + Shift + K
  • Move line up/down: βŒ₯ + ↑/↓ or Alt + ↑/↓
  • Copy line up/down: ⇧ + βŒ₯ + ↑/↓ or Shift + Alt + ↑/↓
  • Toggle line commment: ⌘ + / or Ctrl + /

Selecting

  • Select the next/previous letter: ⇧ + β†’/← or Shift + β†’/←
  • Select the next/previous word: ⇧ + βŒ₯ + β†’/← or Ctrl + Shift + β†’/←
  • : Select current line / current and next line / etc : ⌘ + L / ⌘ + L ⌘ + L or Ctrl + L / Ctrl + L Ctrl + L
  • Select line up/down: ⇧ + ↑/↓ or Ctrl + Shift + ↑/↓
  • Select to the beginning/end of file: ⇧ + ⌘ + ↑/↓ or Ctrl + Shift + Home/End
  • Expand/Shrink selection: ⇧ + βŒƒ + β†’/← or Shift + Alt + β†’/←

Navigating

  • Go to the next/previous word: βŒ₯ + β†’ or Ctrl + β†’/←
  • Go to beginning/end of line: ⌘ + β†’/← or Home/End
  • Go to beginning/end of file: ⌘ + ↑/↓ or Ctrl + Home/End
  • Go to line: βŒƒ + G or Ctrl + G
  • Go to file / Go to previous file: ⌘ + P / ⌘ + P ⌘ + P or Ctrl + P / Ctrl + P Ctrl + P
  • Open next opened tab: βŒƒ + Tab or Ctrl + Tab
  • Go to symbol: ⇧ + ⌘ + O or Ctrl + Shift + O
  • Go to symbol in the workspace: ⌘ + T or Ctrl + T

Files

  • Save file: ⌘ + S or Ctrl + S
  • Close file: ⌘ + W or Ctrl + W
  • Close all files: ⌘ + K ⌘ + W or Ctrl + K Ctrl + W
  • Open previously closed: ⇧ + ⌘ + T or Ctrl + Shift + T

Search

  • Find: ⌘ + F or Ctrl + F
  • Replace: ⌘ + βŒ₯ + F or Ctrl + H
  • Find next/previous: ⌘ + G / ⇧ + ⌘ + G or Ctrl + F3 / Shift + Ctrl +F3

Cursors

  • Insert cursor: βŒ₯ + Click or Alt + Click
  • Insert cursor above: βŒ₯ + ⌘ + ↑/↓ or Ctrl + Alt + ↑
  • Select next match: ⌘ + D or Ctrl + D
  • De-select previous match: ⌘ + U or Ctrl + U
  • Select all occurrences of current word: ⇧ + ⌘ + L or Ctrl + Shift + L
  • Remove cursors: Escape

Display

  • Show Explorer: ⇧ + ⌘ + E or Ctrl + Shift + E
  • Show Search: ⇧ + ⌘ + F or Ctrl + Shift + F
  • Show Source Control: ⇧ + βŒƒ + G or Ctrl + Shift + G
  • Show Debug: ⇧ + ⌘ + D or Ctrl + Shift + D: Show Debug
  • Show Extensions: ⇧ + ⌘ + X or Ctrl + Shift + X
  • Toggle Sidebar: ⌘ + B or Ctrl + B
  • Split editor: ⌘ + \ or Ctrl + \
  • Enter zen mode: ⌘ + K Z or Ctrl + K Z
  • Show (focus) integrated terminal: βŒƒ + ` or Ctrl + `
  • Focus first/second/third editor window: ⌘ + 1 / ⌘ + 2 / ⌘ + 3 or Ctrl + 1 / Ctrl + 2 / Ctrl + 3

Alternatively, you can also check the official keyboard shortcuts of VS Code for macOS and for Windows.

Top comments (1)

Collapse
 
s0meon3 profile image
Gabriel CorrΓͺa

Thanks, been looking for this for a while!

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›