Skip to content
igaurab edited this page Nov 18, 2026 · 3 revisions

Three modes, shown in the top bar: INSERT (typing), NORMAL (vim keys in the editor) and CELL (Jupyter's command mode: the whole cell is selected and keys act on cells). escape goes INSERT → NORMAL → CELL; enter or i goes back into the editor in NORMAL mode (i again types). Clicking a cell's header selects it; in cell mode any click only selects the cell it lands on. f1 (or ? in cell mode) shows every key; the list lives in src/gpython/keymap.py.

The editor is vim: where an app shortcut and a vim key collide, vim wins inside the editor and the app shortcut stays in cell mode (escape first). The cursor is a block coloured like the mode's badge: yellow NORMAL, green INSERT, magenta VISUAL, red REPLACE; in cell mode the selected cell gets a blue bar and a blue block where its cursor is; the cell being edited has a bar in the colour of the vim mode (yellow, green, purple, red, like the badge and the cursor), a cell that needs a rerun (stale) a salmon one, and the cell the debugger is paused in a red one, the red of the DEBUG badge (:set cursor=bar|underline brings back the terminal's own cursor, coloured the same way). See What changed for vim.

Everywhere

Key Action
shift+enter Run cell (markdown: render it), then go to the cell below (a new cell only on the last one)
ctrl+enter / ctrl+shift+enter Run cell (markdown: render it), stay
ctrl+e Run cell, stay — cell mode only (in the editor: vim scroll / insert-mode copy)
alt+enter Run cell and insert a new cell below
f5 / f4 Run all / run stale cells
f6 Python environment: switch venv/interpreter, new uv or python venv, install packages
ctrl+k Interrupt running code
ctrl+n / ctrl+shift+n New cell below (cell mode only; in the editor ctrl+n is vim's line down / completion) / above
ctrl+d Delete cell, cell mode only (cells that used its variables are marked stale, or re-run when reactive; u undoes); in the editor it is vim's half page down / dedent
alt+↑/↓, ctrl+↑/↓ Previous / next cell
ctrl+home / ctrl+end First / last cell
alt+shift+↑/↓ Move the cell up / down
ctrl+s / :w Save (asks for a name if untitled)
ctrl+b Toggle the file explorer, in every mode (see Files, windows and tabs)
ctrl+h / ctrl+l Focus the window to the left / right; ctrl+h from the leftmost window goes to the explorer when it is shown, ctrl+l from the explorer goes back (not in insert mode, where ctrl+h is backspace)
ctrl+w … Window commands (not in insert mode, where it deletes a word): s split, v vsplit, h j k l move, q close, o only, z zoom, T / M to tab and back, space window manager
f1 Help
ctrl+o Toggle the outline panel: each cell with what it defines, live types after a run, dependency edges; enter jumps (cell mode; in the editor it is vim's jump back / one-shot command; :outline)
ctrl+v Toggle the variables panel; it is also the debugger while a cell is paused (see Variables and the debugger; cell mode; in the editor it is vim's visual block / literal insert; :vars)
f3 Toggle run mode, saved: lazy (default, cells that use the variables are only marked stale) / reactive (they re-run)
ctrl+p Command palette: run all, restart kernel, … (cell mode; in the editor vim's line up / completion)
ctrl+q / :q Quit (asks when there are unsaved changes; :q! does not)

Cell mode

Whether you are in cell mode or in the editor is one choice for the whole notebook: moving across a rendered markdown or hidden-code cell (which is always selected as a cell), deleting, undoing, searching or switching tabs keeps it; escape, enter/i and a click inside an editor while editing change it.

Key Action
j / k (3j) Select next / previous cell
gg / G / 3G Select first / last / third cell
enter / i Edit the cell (vim normal mode; press i again to type); on markdown, show its source
a / b Insert a cell above / below
dd Delete cell (3dd three; u brings them back)
u (or z) / ctrl+r Undo / redo the last change in the notebook: text typed in any cell, cell delete, move, insert, markdown/code switch
yy / x / p / P Copy / cut / paste below / paste above
J / K Move the cell down / up
m / y Markdown / code cell
h Hide / show the cell's code (marimo hide_code)
c / C Collapse output / clear output
v View the cell's image (a matplotlib figure) full screen (the bottom bar offers it when the selected cell has one): + - zoom, 0 fit, 1 actual size, h j k l pan, n p next / previous image, s save as PNG, o open in the browser, q closes
l Toggle line numbers
t Show / hide each cell's run time in its header (off by default; :set time, timing = true in the config)
gt / gT Next / previous tab
/ Jump to /3, or select the next cell matching /text
n / N Select the next / previous cell matching the last search
escape Clear pending keys and the search highlight
:, ? Ex command, help

Ex commands

:w [file], :wa, :q, :q!, :wq, :qa, :wqa, :e file, :sp [file], :vs [file], :only, :tabnew [file], :tabclose, :tabn, :tabp, :ls, :noh, :Ex, :run, :timeit [n], :runabove, :runbelow, :stale, :restart, :clear, :s/a/b/g (:%s, :'<,'>s, :&&), :set vim|novim|lazy|nolazy|nu|nonu|time|notime|statusbar|nostatusbar|cursor=block|bar|underline, :set debug_detail=…, :vars, :debug, :stop if …, :md, :code, :theme [name], :N (go to cell N), :help. Save and quit commands forgive caps lock: :Q!, :WQ!, :Wq, :W, :X, :QA! work like :q!, :wq!, … (only these; :D is not :d). :set novim, line numbers, the run time display, the run mode and the theme are remembered in ~/.config/gpython/config.toml (vim, line_numbers, timing, run_mode, theme, status_bar).

Editing

Enter indents after : or an open bracket and dedents after return/pass/…; backspace in leading whitespace removes one indent level; Tab inserts four spaces.

Terminals without shift+enter

shift+enter and ctrl+enter need a terminal that reports them (Ghostty, Kitty, WezTerm, iTerm2). In Terminal.app use alt+enter, space r c in the editor, or escape then ctrl+e / ctrl+n in cell mode.

The editor's vim keys are on the Vim page.

Clone this wiki locally