VS Code Keyboard Shortcuts for Everyday Editing

By Jay, editor

Published: March 15, 2026 · Updated: October 10, 2026

This guide covers default Visual Studio Code shortcuts for daily jobs: reaching a file or symbol, changing several places at once, moving lines, searching, and using the terminal, noting keys that behave unexpectedly. Keys are given for Windows first and Mac second, as on the VS Code shortcut reference; Linux mostly follows the Windows keys, and that page notes the exceptions.

Some bindings are chords. For Ctrl + K, Ctrl + S (Cmd + K, Cmd + S) press the first combination, release, then press the second. When the second half has no modifier, let go of Ctrl before the letter: Ctrl + K, W closes one editor group, while Ctrl + K, Ctrl + W closes all editors.

Ctrl + P (Cmd + P) is Quick Open: type part of a file name and pick the file instead of clicking through the Explorer tree, which pays off most in deep folder structures. VS Code's tips page adds that pressing the shortcut again cycles through recently opened files, and that typing a question mark in the box lists what else Quick Open can do.

Inside a file, Ctrl + Shift + O (Shift + Cmd + O) lists its symbols in the same box; adding a colon so the box reads @: groups them by kind. When you know a name but not its file, Ctrl + T (Cmd + T) searches symbols across the workspace. For a line number from an error message, Ctrl + G jumps there. On a Mac this stays Ctrl + G, because Cmd + G is Go to next match.

From a symbol, F12 goes to its definition and Shift + F12 lists its references in a peek window, on both systems. To keep your place, Alt + F12 (Option + F12) shows the definition inline, and Ctrl + K, F12 (Cmd + K, F12) opens it in an editor group beside the current one.

After a jump, Alt + Left returns to the previous cursor location, also across files, and Alt + Right goes forward again. On a Mac these are Ctrl + - and Ctrl + Shift + -; Cmd + - zooms out.

2. Change several places at once

Ctrl + D (Cmd + D) selects the word at the cursor, and each further press adds the next match as another selection, so typing changes them together. It suits a short rename where you can see each hit. If a match should stay untouched, Ctrl + K, Ctrl + D (Cmd + K, Cmd + D) drops it and selects the following one, and Ctrl + U (Cmd + U) undoes the last cursor operation without changing text.

Ctrl + Shift + L (Shift + Cmd + L) puts a cursor on each occurrence of the selected text in the file. It matches text, not meaning, so a common name also catches unrelated uses. To rename a variable or function, F2 renames the symbol and updates the places that reference it.

Without repeated text, Alt + Click (Option + Click) adds a cursor at each click, and Ctrl + Alt + Down (Option + Cmd + Down) stacks one on the next line in the same column. Where Alt + Click does not work, as on some Linux distributions, the Multi-cursor Modifier setting can switch it to Ctrl. Shift + Alt + I (Shift + Option + I) puts a cursor at the end of each selected line: select a pasted list, press it, and add a comma to each line in one go.

Shift + Alt + Right grows the selection by syntax element, from word to expression to block, and Shift + Alt + Left shrinks it; on a Mac these take three modifiers: Ctrl + Shift + Cmd + Right and Ctrl + Shift + Cmd + Left.

3. Edit whole lines without selecting them

With nothing selected, Ctrl + X and Ctrl + C (Cmd + X, Cmd + C) cut or copy the whole line the cursor is on, so an empty-selection copy fills the clipboard with a line rather than nothing. Ctrl + Shift + K (Shift + Cmd + K) deletes the line outright.

Alt + Down and Alt + Up (Option + Down, Option + Up) move the current or selected lines. With Shift added, Shift + Alt + Down (Shift + Option + Down) duplicates the line instead. VS Code's tips page notes that the copy-line keys are unbound on Linux because they would conflict with Ubuntu shortcuts.

Ctrl + Enter (Cmd + Return) starts a new line below wherever the cursor sits, with no need to press End first.

Ctrl + / (Cmd + /) toggles a line comment, so it uncomments lines that are already commented. For a predictable result, Ctrl + K, Ctrl + C (Cmd + K, Cmd + C) always adds a comment and Ctrl + K, Ctrl + U (Cmd + K, Cmd + U) always removes it.

Ctrl + F (Cmd + F) opens the Find widget and Ctrl + H opens it with the replace field; on a Mac, Replace is Option + Cmd + F. F3 and Shift + F3 (Cmd + G, Shift + Cmd + G) step through the matches.

Three toggles change what counts as a match: Alt + C for case, Alt + W for whole word and Alt + R for regular expressions (Option + Cmd + C, Option + Cmd + W, Option + Cmd + R). They also work in the multi-file Search view. With regular expressions on, parentheses define groups that the replace field can reuse as $1, $2 and so on.

Alt + Enter (Option + Return) links Find to multi-cursor editing: it turns all matches into selections, each with its own cursor. In the Search view the same Windows key instead copies the results into a search editor tab (Cmd + Return on a Mac).

Across the project, Ctrl + Shift + F (Shift + Cmd + F) opens the Search view and Ctrl + Shift + H (Shift + Cmd + H) opens it ready to replace in files. Ctrl + Shift + J (Shift + Cmd + J) shows the fields for files to include and exclude so the change stays out of folders it should not touch.

5. Work in the integrated terminal

Ctrl + ` shows or hides the terminal; the key is the backtick, with Ctrl on a Mac too. Ctrl + J (Cmd + J) is different: it toggles the whole panel holding the terminal, Problems and Output. Ctrl + Shift + 5 splits the active terminal. On a Mac the split key is Cmd + \, the same combination that splits the editor, so give the terminal focus first. According to the terminal documentation, a split terminal on Windows starts in the folder its parent started in, while on macOS and Linux it inherits the parent's current working directory.

For long output, Ctrl + Up and Ctrl + Down (Cmd + Up, Cmd + Down) jump to the previous or next command's prompt, which needs shell integration. Ctrl + F (Cmd + F) searches the terminal buffer; the terminal documentation explains how to pass that key to the shell instead.

In the terminal, Ctrl + C (Cmd + C) copies the selection, but Ctrl + Shift + C is not a copy key on Windows: it opens the system's own terminal outside VS Code.

6. Use the Command Palette for the rest

Ctrl + Shift + P (Shift + Cmd + P), or F1, opens the Command Palette, a searchable list of all available commands, including those without a default key. Type a few letters of the task: “transform” finds the commands that change selected text to uppercase, lowercase or title case, and Terminal: Run Selected Text in Active Terminal sends the selected editor text, or the current line if nothing is selected, to the terminal.

The palette also teaches keys, because it shows each command's default shortcut next to its name. To change a binding, Ctrl + K, Ctrl + S (Cmd + K, Cmd + S) opens the Keyboard Shortcuts editor; filter it with the search field and edit an entry with the pencil icon.

Mac keys that are not a Cmd-for-Ctrl swap

Most Mac bindings replace Ctrl with Cmd and Alt with Option. These from this guide do not:

WindowsMacWhat it does
Ctrl + GCtrl + GGo to line
Alt + LeftCtrl + -Go back
Ctrl + HOption + Cmd + FReplace in file
Ctrl + `Ctrl + `Toggle integrated terminal
Ctrl + Shift + 5Cmd + \Split terminal

Search the shortcut reference interactively

Search all shortcuts