Keyboard shortcuts
Every key the editor understands. On a Mac, Ctrl is ⌘ and Alt is ⌥ unless shown otherwise. Press F1 in the editor to see this list there.
Compiling and the PDF
| Windows and Linux | Mac | What it does |
|---|
| Ctrl + S | ⌘ + S | Save and compile |
| Ctrl + Enter | ⌘ + Enter | Compile |
| Ctrl + Alt + J | ⌘ + ⌥ + J | Jump from the cursor to the same place in the PDF |
| Double-click in the PDF | Double-click in the PDF | Jump from the PDF to the source line |
| Ctrl + F (PDF last clicked) | ⌘ + F (PDF last clicked) | Search the PDF |
Editing lines
| Windows and Linux | Mac | What it does |
|---|
| Alt + ↑ / ↓ | ⌥ + ↑ / ↓ | Move the line or selection up / down |
| Shift + Alt + ↑ / ↓ | ⇧ + ⌥ + ↑ / ↓ | Copy the line up / down |
| Ctrl + Shift + K | ⌘ + ⇧ + K | Delete the line |
| Ctrl + Backspace / Delete | ⌥ + Backspace / Delete | Delete the word before / after the cursor |
| Ctrl + Shift + \ | ⌘ + ⇧ + \ | Jump to the matching bracket |
| Alt + L | Ctrl + L | Select the line |
| Escape | Escape | Back to a single cursor |
Several cursors
| Windows and Linux | Mac | What it does |
|---|
| Ctrl + D | ⌘ + D | Add the next occurrence of the selection |
| Ctrl + Shift + L | ⌘ + ⇧ + L | Select every occurrence of the selection |
| Ctrl + Alt + ↑ / ↓ | ⌘ + ⌥ + ↑ / ↓ | Add a cursor on the line above / below |
| Alt + drag | ⌥ + drag | Select a rectangle |
Finding
| Windows and Linux | Mac | What it does |
|---|
| Ctrl + F | ⌘ + F | Find in the file |
| Ctrl + H | ⌘ + H | Find and replace |
| F3 · Ctrl + G | F3 · ⌘ + G | Next match |
| Shift + F3 · Ctrl + Shift + G | ⇧ + F3 · ⌘ + ⇧ + G | Previous match |
| Ctrl + Alt + G | ⌘ + ⌥ + G | Go to line |
| Escape | Escape | Close the find panel |
Undo and selection
| Windows and Linux | Mac | What it does |
|---|
| Ctrl + Z | ⌘ + Z | Undo |
| Ctrl + Y · Ctrl + Shift + Z | ⌘ + ⇧ + Z | Redo |
| Ctrl + U · Alt + U | ⌘ + U · ⌘ + ⇧ + U | Undo · redo the last selection change |
| Ctrl + A | ⌘ + A | Select all (also in submitted, read-only files) |
| Shift + arrows | ⇧ + arrows | Extend the selection |
| Ctrl + Shift + ← / → | ⌥ + ⇧ + ← / → | Extend the selection by a word |
| Alt + ← / → | Ctrl + ← / → | Move by a syntax unit (a command, a group) |
Moving around
| Windows and Linux | Mac | What it does |
|---|
| Ctrl + ← / → | ⌥ + ← / → | Previous / next word |
| Home · End | ⌘ + ← / → | Start / end of the line |
| Ctrl + Home · Ctrl + End | ⌘ + ↑ / ↓ | Start / end of the file |
| Page Up · Page Down | Page Up · Page Down | Up / down a screen |
The workspace
| Windows and Linux | Mac | What it does |
|---|
| Ctrl + Alt + B | ⌘ + ⌥ + B | Show / hide the file list |
| Ctrl + Shift + M | ⌘ + ⇧ + M | Focus mode: the editor alone, and back |
| F1 | F1 | Keyboard shortcuts |
| Escape | Escape | Close a menu, panel or dialog |
| Ctrl + M, then Tab | ⇧ + ⌥ + M, then Tab | Let Tab move focus out of the editor (press again to turn off) |
| Escape, then Tab | Escape, then Tab | Move focus out of the editor once |
Vim and Emacs keys
Turn on in View → Editing mode, or Settings.
| Windows and Linux | Mac | What it does |
|---|
| Vim | Vim | Normal, insert and visual modes, operators, counts, and the : command line |
| Ctrl + A / E (Emacs) | Ctrl + A / E | Start / end of the line |
| Ctrl + F / B / N / P (Emacs) | Ctrl + F / B / N / P | Forward / back a character, next / previous line |
| Ctrl + D / K (Emacs) | Ctrl + D / K | Delete a character / to the end of the line |