Keyboard shortcuts

Change a shortcut

Preferences › Keyboard Shortcuts lists every command and its keys. You can modify them visually.

Edit directly

In many cases it is probably easier to edit the JSON directly: Command palette › Open Keyboard Shortcuts (JSON).

[
	{ "key": "mod+j", "command": "editor.bold" },
	{ "key": "mod+b", "command": "-editor.bold" }
]
Field Type Default Description
key string The keys, such as mod+shift+k. mod is Cmd on macOS and Ctrl elsewhere. Two keys separated by a space are pressed one after the other, such as mod+k mod+s.
command string The command's ID. Right-click a command in Preferences › Keyboard Shortcuts › Copy Command ID. A - in front removes a default key, such as -editor.bold.
when string always Where the key works, such as sourceEditorFocus && editorLanguage == latex. Combine keys with &&, ||, !, ==, != and parentheses.
args any none Passed to the command.

Keys: a to z, 0 to 9, f1 to f24, enter, tab, space, backspace, delete, escape, insert, home, end, pageup, pagedown, up, down, left, right, and ; = , - . / ` [ \ ] '. Modifiers: mod, ctrl, shift, alt (option on macOS) and cmd (win on Windows).

when key True when
sourceEditorFocus The source editor has the focus
visualEditorFocus The visual editor has the focus
editorLanguage The focused editor's language: latex, typst, markdown, bibtex or other
inputFocus A text field has the focus
textInputFocus A text field, an editor or the terminal has the focus
terminalFocus The terminal has the focus
dialogFocus A dialog has the focus
editorKeymap The source editor's keybindings: default, vim or emacs
isMac, isWindows, isLinux The system Texpile runs on

Anywhere

CtrlKCommand palette (also Ctrl Shift P)
CtrlTGo to file
CtrlAltEnterCompile, or stop a running compile
CtrlShiftFFind in files
AltZInsert a citation from Zotero (Cmd Option Z on macOS)
CtrlShiftGSource Control, with the cursor in the message box (Control Shift G on macOS)
CtrlEnterCommit, from the Source Control message box
F8Next spelling problem
ShiftF8Previous spelling problem

Formatting

Ctrl`Inline code
CtrlShift`Code block
CtrlMInline math
CtrlShiftMDisplay math
Ctrl.Superscript (LaTeX, Typst)
CtrlShift,Subscript (LaTeX, Typst)
CtrlShiftXStrikethrough (Markdown)
CtrlShiftBBlock quote (LaTeX, Markdown; Typst in the source editor only)
CtrlAlt1,2,3Heading 1, 2, 3 (\section to \subsubsection in the LaTeX source editor)
CtrlAlt4,5,6Heading 4, 5, 6 (Typst, Markdown)
CtrlShift1,2,3Heading 1, 2, 3, for layouts where Ctrl Alt types a character. Windows and Linux
CtrlAlt0Back to a paragraph (visual editor; Typst and Markdown source)

Visual editor

ShiftEnterNew display equation of the same kind, from inside a display equation
CtrlEnterLeave a code block
TabSwitch between \indent and \noindent in a LaTeX paragraph outside a table or list (Shift Tab too)

Source editor

F12Go to the definition of a label, macro, citation, or \input (also Ctrl click)
F2Rename a Typst symbol in every file
AltEnterQuick fixes (Typst)
CtrlSpaceOpen suggestions, or the symbol search inside math (Control Space on macOS)
CtrlShiftSpaceShow the arguments of the command around the cursor (Cmd Shift Space on macOS)
CtrlShift[Fold the block at the cursor (Cmd Option [ on macOS)
CtrlShift]Unfold the block at the cursor (Cmd Option ] on macOS)
CtrlAlt[Fold every block (Control Option [ on macOS)
CtrlAlt]Unfold every block (Control Option ] on macOS)
TabAccept the starter text in an empty .tex file
EscHide the math preview until the cursor leaves the math
AltF5Next change since the last commit
ShiftAltF5Previous change since the last commit