Keyboard shortcuts
NotebooksThis reference notebook covers nearly every command available in Observable! It’s a big list, but many should be familiar to you, being provided by your operating system. If you have trouble with any of these shortcuts, please let us know in the Observable GitHub feedback repository.
Navigating between cells
Use the keyboard to focus cells for editing.
- Alt-Shift-Down
- Focus next cell
- Alt-Shift-Up
- Focus previous cell
- Mod-J
- At cell reference, jump to definition
- Shift-Ctrl-J
- Jump to previously-focused cell
- Ctrl-Shift-Down
- Move cell down
- Ctrl-Shift-Up
- Move cell up
- Escape
- Blur cell
Inserting and deleting cells
With a cell focused, add cells by inserting or splitting. Remove cells by merging them.
- Mod-Enter
- Insert cell below
- Shift-Ctrl-Enter
- Insert cell above
- Alt-Enter
- Split cell, then focus below
- Alt-Shift-Enter
- Split cell, then focus above
- Alt-Backspace
- At cell start, merge with cell above
- Ctrl-Alt-D
- At cell end, merge with cell below
- Alt-Shift-Cmd-Down
- Copy cell and insert it below
- Alt-Shift-Cmd-Up
- Copy cell and insert it above
Editing text
Write text or code with contextual suggestions, indenting, commenting, and more.
- Shift-Enter
Mod-S - Run cell
- Shift-Mod-U
- Upload a file
- Ctrl-Space
- Show code suggestions
- Tab
- Accept code suggestion
- Ctrl-Shift-P
Mod-. - Pin or unpin editor
- Mod-,
- Show or hide output
- Alt-Shift-F
- Format code automatically
- Shift-Tab
- Indent automatically
- Mod-]
- Indent more
- Mod-[
- Indent less
- Mod-/
- Comment lines
- Backspace
(macOS/iOS only) - Delete character before cursor
- Delete
(macOS/iOS only) - Delete character after cursor
- Ctrl-Backspace
- Delete to start of word before cursor
- Ctrl-Delete
(macOS/iOS only) - Delete to start of word after cursor
- (macOS/iOS only)
- Delete to start of line.
- (macOS/iOS only)
- Delete to end of current line.
- Enter
- Insert a new line, and indent
Editing prose
In Markdown cells, use additional shortcuts for formatting rich text.
- Mod-B
- Bold
- Mod-I
- Italic
- Alt-Shift-5
- Strikethrough
- Mod-K
- Link
- Shift-Mod-7
- Numbered list
- Shift-Mod-8
- Bulleted list
- Alt-Mod-1…6
- Heading 1 (or 2, 3, etc.)
- Alt-Mod-0
- Clear heading
- Shift-Mod-F
- Monospaced font (code)
Navigating text
Text is inserted at the caret, or cursor. You can have multiple carets at the same time.
- Left
(macOS/iOS only) - Move the caret one character backward.
- Right
(macOS/iOS only) - Move the caret one character forward.
- Up
(macOS/iOS only) - Move the caret up one line.
- Down
(macOS/iOS only) - Move the caret down one line.
- Ctrl-Right
- Start of next word
- Ctrl-Left
- Start of previous word
- Home
Alt-Left - Start of line
- End
Alt-Right - End of line
- Cmd-Left
- Start of line, without wrapping
- Cmd-Right
- End of current line, without wrapping
- Ctrl-Home
- Start of cell
- Ctrl-End
- End of cell
- PageUp
- Previous screen
- PageDown
(macOS/iOS only) - Next screen
Multiple carets
- Mod-Click
- Add caret
- Escape
- Clear additional carets
Selecting text
Add the Shift key to the shortcuts above to turn a caret into a text selection. You can have multiple selections at the same time.
- Shift-Left
(macOS/iOS only) - Extend the selection one character backwards.
- Shift-Right
(macOS/iOS only) - Extend the selection one character forwards.
- Shift-Up
- Extend the selection up one line.
- Shift-Down
(macOS/iOS only) - Extend the selection down one line.
- Shift-Ctrl-Left
- Start of previous word
- Shift-Ctrl-Right
- End of next word
- Shift-Home
Shift-Alt-Left - Start of current line
- Shift-End
Shift-Alt-Right - Extend the selection to the end of the current line.
- Shift-Cmd-Left
- Start of current line without wrapping
- Shift-Cmd-Right
- End of the current line without wrapping
- Shift-Ctrl-Home
- Start of current cell
- Shift-Ctrl-End
- End of current cell
- Shift-PageUp
- Previous screen
- Shift-PageDown
(macOS/iOS only) - Next screen
- Mod-A
- Select all
- Escape
- Clear selection
Multiple selections
- Mod-Drag
- Add range selection
- Alt-Mod-Drag
- Add box selection
- Alt-Drag
- Replace selection with box selection
- Escape
- Clear additional selections
Selecting cells
Select cells with these page-level shortcuts to perform bulk actions on multiple cells.
- J
- Select next cell
- K
- Select previous cell
- Shift-J
- Select next and current cell
- Shift-K
- Select previous and current cell
- X
- Select or unselect current cell
- Shift-Enter
- Run cells
- Alt-Up
- Move cells up
- Alt-Down
- Move cells down
- Alt-Shift-Up
- Copy cells up
- Alt-Shift-Down
- Copy cells down
- .
- Pin or unpin cells
- ,
- Show or hide outputs
- D
Alt-Backspace - Delete cells
- C
- Add comment
- O
Mod-Enter - Insert cell below
- Shift-O
Shift-Mod-Enter - Insert cell above
- Alt-Enter
- Insert cell of same type below
- Shift-Alt-Enter
- Insert cell of same type above
- Shift-A
- Select all
- Escape
- Clear selection
Find and Replace
Use the Find and Replace pane (magnifying glass icon) to find and replace text or code on the page.
- Shift-Mod-F
- Open the Find pane
- Mod-G
- Find next occurrence
- Shift-Mod-G
- Find previous occurrence
- Enter
- In Find input, find next occurrence
- Shift-Enter
- In Find input, find previous occurrence
- Enter
- In Replace input, replace current occurrence
Clipboard
You can copy-and-paste code either within or across cells.
- Mod-C
- Copy the selected text. If there is no selection, copy the current line.
- Mod-X
- Cut the selected text. If there is no selection, cut the current line.
- Mod-V
- Paste the current clipboard contents. If the previous cut or copy was done without selecting (see the previous Clipboard key definitions), paste at the start of the next line rather than at the caret.
- Ctrl-K
- Kill (cut) the selected text. If there is no selection, kill the text between the caret and the end of the current line.
- Ctrl-Y
- Yank (paste) the previously killed text.
History
You can undo and redo changes to code; each cell maintains a separate history. (Observable doesn’t yet support undo and redo to cell-level commands, but you can revert unwanted changes in the notebook menu.)
- Mod-Z
- Undo the last change.
- Ctrl-Y
- Redo the last undone change.
Other
- ?
- If a cell is not focused, show keyboard shortcuts. Be sure text is not selected and the Search form is not in use.
- /
- If a cell is not focused, display the Search form.
- F
- Enter full screen.
- T
- Enter Tinker mode.