Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Add Command Mode documentation (#5696)

Trevor Manz00b48be2a99c
diff --git a/docs/guides/editor_features/overview.md b/docs/guides/editor_features/overview.md
index c4a8470d97..087fb8131a 100644
--- a/docs/guides/editor_features/overview.md
+++ b/docs/guides/editor_features/overview.md
@@ -19,6 +19,7 @@ To access these settings, click the gear icon in the top-right of the editor:
A non-exhaustive list of settings:
+- [Command mode](#command-mode)
- Outputs above or below code cells
- [Disable/enable autorun](../reactivity.md#configuring-how-marimo-runs-cells)
- Package installation
@@ -32,15 +33,43 @@ A non-exhaustive list of settings:
- [LLM coding assistant](ai_completion.md)
- [Module autoreloading](../configuration/runtime_configuration.md#on-module-change)
+## Command mode
+
+marimo distinguishes between editing cell content and working with cells at the
+notebook level.
+
+**Command mode** lets you navigate, select, and manipulate _cells_ rather than
+editing their contents.
+
+**Enter/Exit:**
+
+- Enter command mode: `Esc` (from cell editor)
+- Exit command mode: `Enter` or click on a cell
+
+**Shortcuts:**
+
+- `↓`/`↑` - navigate cells
+- `Shift+↓`/`Shift+↑` - multi-select cells
+- `Enter` - edit selected cell
+- `a`/`b` - new cell above/below
+- `c`/`v` - copy/paste cells
+- `s` - save notebook
+- `Shift+Enter` - run cell and move to next
+- `Ctrl/Cmd+↑` / `Ctrl/Cmd+↓` - jump to top/bottom of notebook
+
+When [vim keybindings](#vim-keybindings) are enabled, additional shortcuts are available.
+
### Vim keybindings
-marimo supports vim keybindings.
+marimo supports vim keybindings that extend to notebook editing. Within cells,
+use standard vim modes. Press `Esc` from normal mode to enter [command
+mode](#command-mode) for notebook navigation.
-**Additional bindings/features:**
+**Cell editing additions:**
- `gd` - go to definition
-- `dd` - when a cell is empty, delete it
-- `:w` - to save the notebook
+- `dd` - delete empty cell
+- `:w` - save notebook
**Custom vimrc:**
@@ -64,6 +93,23 @@ vimrc = relative/path/.vimrc
///
+**Command mode additions:**
+
+When vim keybindings are enabled, press `Esc` from normal mode to enter
+[command mode](#command-mode) with additional vim-specific keybindings:
+
+- `j`/`k` - navigate cells
+- `gg`/`G` - first/last cell
+- `Shift+j`/`k` - extend selection
+- `dd` - delete cell
+- `yy` - copy cell
+- `p`/`P` - paste below/above
+- `o`/`O` - new cell below/above
+- `u` - undo deletion
+- `i` - edit cell (i.e., return to normal mode)
+
+Press `i` or `Enter` to return to cell editing.
+
## Overview panels
marimo ships with the IDE panels that provide an overview of your notebook
@@ -114,6 +160,7 @@ configuration.
_Missing a shortcut? File a
[GitHub issue](https://github.com/marimo-team/marimo/issues)._
+
## Command palette
Hit `Cmd/Ctrl+K` to open the command palette.