Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Keyboard Shortcuts

Shortcuts use the Windows key names shown below. Modifier keys must match the binding exactly. For example, Ctrl+Shift+S is not Save.

KeysAction
Left / Right; Ctrl+Left / Ctrl+RightMove by character; move by word
Up / Down; PgUp / PgDnMove by line; move by page
Home; EndMove to first non-blank, then line start; move to line end
Ctrl+Home; Ctrl+EndMove to start; move to end of file
Shift + any movement key; Shift+clickExtend the selection
Ctrl+A; EscSelect all; collapse selections
Double-click; triple-clickSelect a word; select a line
Backspace / Delete; Ctrl+Backspace / Ctrl+DeleteDelete a character; delete a word
EnterInsert a line break and keep indentation
Tab; Shift+TabInsert indentation; indent or outdent selected lines
Ctrl+]; Ctrl+[Indent; outdent the touched lines (also for a caret)
Alt+Up / Alt+DownMove the touched lines up / down
Shift+Alt+Up / Shift+Alt+DownCopy the touched lines up / down
Ctrl+Shift+KDelete the touched lines
Ctrl+Enter; Ctrl+Shift+EnterInsert a line below; above
Ctrl+GGo to line: N, N:C or N,C, -N from the end (Esc restores)
InsertToggle overtype mode
Ctrl+Z; Ctrl+Y / Ctrl+Shift+ZUndo; redo
Ctrl+C / Ctrl+X / Ctrl+VCopy; cut; paste. Copy or cut the current line when nothing is selected.
Ctrl+SSave
Ctrl+K PCopy the full path of the file
Ctrl+W; Ctrl+F4Close the file and return to the empty state (unsaved changes ask first)
Alt+F4; Ctrl+Shift+WQuit the application (unsaved changes ask first)
Ctrl+Shift+P; F1Open the Command Palette
Ctrl+PShow recent and favorite commands
Ctrl+Space (palette)Add or remove the selected command from favorites
Up / Down / PgUp / PgDn (palette)Move through palette entries
Enter or click (palette); EscRun the selected command; close the palette
Wheel; Ctrl+Up / Ctrl+DownScroll vertically
Alt+PgUp / Alt+PgDnScroll a page; the caret stays
Drag the slider; press the strip at the right edgeScroll; jump to that place
Shift+wheelScroll horizontally
Ctrl+= / Ctrl+Shift+= / Ctrl+Numpad+; Ctrl+- / Ctrl+Numpad-; Ctrl+0Zoom in; zoom out; reset zoom
Ctrl+wheelZoom in or out
F11Toggle full screen (the status line stays)
Ctrl+K Ctrl+SShow the keyboard shortcuts

Mouse clicks place the caret. Shift+click extends the current selection. Commands without a shortcut are available by name in the Command Palette, for example File: Copy File Name, which copies the file name.

Search and Replace

KeysAction
Ctrl+F; Ctrl+HOpen the search box; open it with the replace field
Enter / Shift+Enter; F3 / Shift+F3Next / previous match
Alt+EnterSelect all matches
Alt+C; Alt+WToggle Match Case; toggle Whole Word
Alt+G; Alt+RToggle Glob; toggle RegEx. Both off is Text.
Alt+LToggle Find in Selection
Enter or Ctrl+Shift+1 (replace field)Replace the current match and go to the next
Ctrl+Alt+EnterReplace all matches in one undo step
Alt+PToggle Preserve Case
EscClose the search box

Glob: ? matches one character; * matches the shortest text within a line, and a trailing * matches the rest of the line. Replacements use the VS Code syntax: $1, $<name>, $0, $$, \n, \t, \u, \l, \U and \L.

Multiple Cursors

KeysAction
Ctrl+D; Ctrl+K Ctrl+DAdd the next occurrence; move the last selection to it
Ctrl+Shift+L; Ctrl+F2Select all occurrences
Ctrl+Alt+Up / Ctrl+Alt+DownAdd a cursor above / below
Shift+Alt+IAdd cursors to the ends of the selected lines
Ctrl+LSelect the line, then extend by lines
Ctrl+UUndo the last cursor operation
Alt+clickAdd or remove a cursor
Shift+Alt+drag; middle-dragColumn selection
Ctrl+Shift+Alt + arrows / PgUp / PgDnColumn selection by keys

At most editor.multiCursorLimit selections (10,000 by default) are created; larger requests are refused with a message on the status line.

Code

KeysAction
Ctrl+K MChange Language Mode (or Plain Text)
Ctrl+/Toggle Line Comment (block comments per line in CSS, HTML, XML, Markdown)
Ctrl+K Ctrl+C; Ctrl+K Ctrl+UAdd Line Comment (also to commented lines); Remove Line Comment
Shift+Alt+AToggle Block Comment
Ctrl+Shift+\Go to the matching bracket
Shift+Alt+Right; Shift+Alt+LeftExpand the selection to the enclosing syntax node; shrink it back
Ctrl+Shift+OGo to a symbol of the file
( [ { " ' (language-dependent)Insert the closing character; with a selection, wrap it
Backspace between an empty pairDelete both characters
Enter after (, [, { (and : in Python and YAML)New line indented one level

Spelling

With spelling on (View: Toggle Spelling, spelling.enabled):

KeysAction
Ctrl+.Suggestions for the misspelled word, then Add to Dictionary and Ignore
Enter (Spelling palette)Replace the word with the selected suggestion (one undo step)
F8; Shift+F8Select the next; previous misspelled word (wraps)