Skip to main content
marimo provides extensive keyboard shortcuts to help you edit notebooks efficiently. Whether you prefer standard keybindings or vim mode, marimo gives you powerful tools for navigating and editing cells without reaching for the mouse.

Viewing Shortcuts

Access the keyboard shortcuts reference:
  • Press Ctrl/Cmd+Shift+H to open the hotkeys menu
  • View shortcuts directly in the settings menu (⚙️ → Hotkeys)
The hotkeys menu shows platform-specific shortcuts (⌘ on Mac, Ctrl on Windows/Linux) and indicates which shortcuts you’ve customized.

Essential Shortcuts

These shortcuts work in both default and vim modes:

Cell Operations

ActionShortcut (Mac)Shortcut (Windows/Linux)
Run cellCmd+EnterCtrl+Enter
Run cell and create belowShift+EnterShift+Enter
Create cell belowCmd+BCtrl+B
Create cell aboveCmd+Shift+BCtrl+Shift+B
Delete cellCmd+BackspaceCtrl+Backspace
Move cell upCmd+Shift+UpCtrl+Shift+Up
Move cell downCmd+Shift+DownCtrl+Shift+Down
Focus cell aboveCtrl+UpCtrl+Up
Focus cell belowCtrl+DownCtrl+Down

Code Editing

ActionShortcut (Mac)Shortcut (Windows/Linux)
Format cellCmd+Shift+FCtrl+Shift+F
Trigger completionTab or Cmd+SpaceTab or Ctrl+Space
AI assistanceCmd+Shift+ECtrl+Shift+E
Find and replaceCmd+FCtrl+F
Go to definitionF12 or Cmd+ClickF12 or Ctrl+Click
UndoCmd+ZCtrl+Z
RedoCmd+Shift+ZCtrl+Shift+Z

Global Actions

ActionShortcut (Mac)Shortcut (Windows/Linux)
Save notebookCmd+SCtrl+S
Command paletteCmd+KCtrl+K
Run all stale cellsCmd+Shift+RCtrl+Shift+R
Interrupt executionCmd+ICtrl+I
Toggle sidebarCmd+\Ctrl+\
Toggle terminalCmd+JCtrl+J
Show helpCmd+Shift+HCtrl+Shift+H

Vim Mode

marimo supports vim keybindings for modal editing, bringing familiar vim workflows to notebook editing.

Enabling Vim Mode

Via UI:
  1. Open settings (⚙️)
  2. Navigate to “Keymap” tab
  3. Select “vim” preset
Via Configuration:
marimo.toml
[keymap]
preset = "vim"

Vim Mode Basics

Vim mode provides three modes:
  • Normal mode: Navigate and manipulate cells (press Esc to enter)
  • Insert mode: Edit cell content (press i, a, o, etc. to enter)
  • Visual mode: Select text (press v in normal mode)

Vim Keybindings

When vim mode is enabled: Normal mode (cell navigation):
KeyAction
jFocus cell below
kFocus cell above
ddDelete cell
yyCopy cell
pPaste cell below
oCreate cell below and enter insert mode
OCreate cell above and enter insert mode
Shift+JMove cell down
Shift+KMove cell up
ggGo to first cell
GGo to last cell
Ctrl+DScroll down
Ctrl+UScroll up
Insert mode (code editing):
  • Standard vim editing commands work within cells
  • Esc returns to normal mode
  • Ctrl+[ also exits to normal mode
Visual mode:
  • v enters character-wise visual mode
  • V enters line-wise visual mode
  • Ctrl+V enters block visual mode

Custom vimrc

Load custom vim keybindings from a vimrc file:
pyproject.toml
[tool.marimo.keymap]
preset = "vim"
vimrc = "configs/.vimrc"  # Path relative to pyproject.toml
Or in user config:
marimo.toml
[keymap]
preset = "vim"
vimrc = "/home/user/.vimrc"  # Absolute path
Example vimrc:
.vimrc
" Custom vim mappings for marimo
imap jj <Esc>
nmap <C-h> :tabprevious<CR>
nmap <C-l> :tabnext<CR>
Not all vim features are supported. marimo implements core vim navigation and editing commands optimized for notebook workflows.

Custom Keybindings

Customize any shortcut to match your preferences.

Via Settings Menu

  1. Open settings (⚙️)
  2. Navigate to “Hotkeys” tab
  3. Click on a shortcut to edit
  4. Press your desired key combination
  5. Save changes

Via Configuration File

Edit keybindings in your marimo.toml:
marimo.toml
[keymap]
preset = "default"

[keymap.overrides]
"cell.run" = "Cmd+R"              # Custom run shortcut
"cell.createBelow" = "Cmd+N"      # Custom new cell
"global.save" = "Cmd+Shift+S"     # Custom save
"cell.format" = "Cmd+Shift+P"     # Custom format
Key format:
  • Use + to combine modifier keys
  • Modifiers: Cmd, Ctrl, Shift, Alt
  • Use Cmd on Mac, Ctrl on Windows/Linux
  • Special keys: Enter, Space, Escape, Tab, Backspace, Delete
  • Arrow keys: Up, Down, Left, Right
  • Function keys: F1, F2, …, F12
Examples:
"cell.run" = "Ctrl+Enter"           # Ctrl+Enter on all platforms
"cell.createBelow" = "Cmd+Shift+N"  # Cmd+Shift+N (use Ctrl on Windows)
"global.save" = "Ctrl+S"            # Standard save
"cell.delete" = "Shift+Delete"      # Shift+Delete

Available Actions

Here are all customizable keyboard shortcuts:
ActionDefault (Mac)Default (Win/Linux)Description
cell.runCmd+EnterCtrl+EnterExecute cell
cell.runAndNewBelowShift+EnterShift+EnterRun and create below
cell.runAndNewAbove--Run and create above
cell.createBelowCmd+BCtrl+BNew cell below
cell.createAboveCmd+Shift+BCtrl+Shift+BNew cell above
cell.deleteCmd+BackspaceCtrl+BackspaceDelete cell
cell.moveUpCmd+Shift+UpCtrl+Shift+UpMove cell up
cell.moveDownCmd+Shift+DownCtrl+Shift+DownMove cell down
cell.moveLeftCmd+Shift+LeftCtrl+Shift+LeftMove to left column
cell.moveRightCmd+Shift+RightCtrl+Shift+RightMove to right column
cell.focusUpCtrl+UpCtrl+UpFocus cell above
cell.focusDownCtrl+DownCtrl+DownFocus cell below
cell.sendToTop--Move to top
cell.sendToBottom--Move to bottom
cell.formatCmd+Shift+FCtrl+Shift+FFormat code
cell.aiCompletionCmd+Shift+ECtrl+Shift+EAI assistance
cell.hideCode--Toggle code visibility
cell.viewAsMarkdown--Render as markdown
cell.fold--Fold cell
cell.unfold--Unfold cell
cell.splitCell--Split cell at cursor
cell.completeTab, Cmd+SpaceTab, Ctrl+SpaceTrigger completion
cell.findAndReplaceCmd+FCtrl+FFind and replace
cell.goToDefinitionF12F12Go to definition
cell.cellActions--Open cell actions
cell.undoCmd+ZCtrl+ZUndo
cell.redoCmd+Shift+ZCtrl+Shift+ZRedo
cell.selectNextOccurrenceCmd+DCtrl+DMulti-cursor select
ActionDefault (Mac)Default (Win/Linux)Description
global.saveCmd+SCtrl+SSave notebook
global.commandPaletteCmd+KCtrl+KOpen command palette
global.runStaleCmd+Shift+RCtrl+Shift+RRun stale cells
global.interruptCmd+ICtrl+IInterrupt execution
global.toggleSidebarCmd+\Ctrl+\Toggle sidebar
global.toggleTerminalCmd+JCtrl+JToggle terminal
global.showHelpCmd+Shift+HCtrl+Shift+HShow shortcuts
global.formatAll--Format all cells
global.foldCode--Fold all cells
global.unfoldCode--Unfold all cells
global.hideCode--Hide all code
global.focusTop--Focus first cell
global.focusBottom--Focus last cell
global.toggleMinimap--Toggle dataflow minimap
global.toggleLanguage--Switch cell language
ActionDefaultDescription
completion.moveUpUp, Ctrl+PPrevious suggestion
completion.moveDownDown, Ctrl+NNext suggestion
ActionDefault (Mac)Default (Win/Linux)Description
markdown.boldCmd+BCtrl+BBold text
markdown.italicCmd+ICtrl+IItalic text
markdown.codeCmd+ECtrl+EInline code
markdown.linkCmd+KCtrl+KInsert link
markdown.orderedList--Ordered list
markdown.unorderedList--Unordered list
markdown.blockquote--Blockquote

Productivity Tips

The command palette (Cmd/Ctrl+K) provides quick access to all marimo actions:
  • Search for commands by name
  • See keyboard shortcuts for each command
  • Execute commands without remembering shortcuts
  • Filter by category (cell, global, etc.)
Examples:
  • Type “format” to find formatting commands
  • Type “run” to see execution options
  • Type “fold” for code folding actions
Select multiple occurrences with Cmd/Ctrl+D:
  1. Place cursor on a variable name
  2. Press Cmd/Ctrl+D to select next occurrence
  3. Continue pressing to select more occurrences
  4. Edit all at once
Alternative: Cmd/Ctrl+Shift+L selects all occurrences at once
Create efficient workflows by chaining shortcuts:Add and run new cell:
  1. Cmd/Ctrl+B (create below)
  2. Type code
  3. Shift+Enter (run and create next)
Refactor with AI:
  1. Write initial code
  2. Cmd/Ctrl+Shift+E (AI refactor)
  3. Review and accept
Format and save:
  1. Cmd/Ctrl+Shift+F (format all)
  2. Cmd/Ctrl+S (save)
Adapt shortcuts to match your most common actions:
marimo.toml
[keymap.overrides]
# Quick cell creation
"cell.createBelow" = "Cmd+N"

# Fast formatting
"cell.format" = "Cmd+Shift+P"

# AI shortcuts
"cell.aiCompletion" = "Cmd+Shift+A"

Conflicting Shortcuts

marimo detects and warns about conflicting keybindings:
When conflicts occur:
  1. marimo shows a warning banner
  2. Click “View conflicts” to see which shortcuts conflict
  3. Reassign one of the conflicting shortcuts
  4. Conflicts are automatically resolved
Avoid assigning the same shortcut to multiple actions in different contexts (e.g., don’t use Cmd+B for both “bold” in markdown and “create cell below” globally).

Platform-Specific Behavior

marimo adapts shortcuts to your platform:

macOS

  • Cmd is the primary modifier (Command/⌘)
  • Ctrl used for navigation (Ctrl+Up/Down)
  • Some shortcuts also work with Ctrl for compatibility

Windows/Linux

  • Ctrl is the primary modifier
  • Windows: Alt behaves like Option on Mac
  • Linux: Follows standard Linux desktop conventions

Auto-Detection

marimo automatically detects your platform and shows the appropriate shortcuts in the UI and help menu.

Resetting Shortcuts

Restore default shortcuts: Reset individual shortcuts:
  1. Open settings → Hotkeys
  2. Click the shortcut you want to reset
  3. Press the reset button
Reset all shortcuts: Remove overrides from your config file:
marimo.toml
[keymap]
preset = "default"
# Remove all [keymap.overrides]
Or delete the entire [keymap] section to restore all defaults.

Accessibility

marimo provides keyboard accessibility features:
  • Full keyboard navigation: All features accessible without a mouse
  • Screen reader support: Proper ARIA labels on interactive elements
  • Focus indicators: Visual feedback for keyboard focus
  • Skip links: Jump to main content quickly
If you encounter accessibility issues, please report them on GitHub or reach out on Discord.

Troubleshooting

Possible causes:
  1. Browser conflicts: Some browsers capture certain shortcuts
    • Solution: Use marimo desktop app or try different browser
  2. OS shortcuts: Operating system may capture shortcuts
    • Solution: Customize conflicting shortcuts in marimo
  3. Extension conflicts: Browser extensions may intercept shortcuts
    • Solution: Disable extensions or use different shortcuts
Test shortcuts:
  1. Open command palette (Cmd/Ctrl+K)
  2. Search for the action
  3. See if shortcut is listed
  4. Try executing from palette instead
Check configuration:
[keymap]
preset = "vim"  # Must be set to "vim"
Reload the page after changing vim mode settings.Ensure you’re in the correct mode:
  • Press Esc to enter normal mode
  • Look for mode indicator (if visible)
  • Try basic commands: j, k, dd
Check file permissions:
ls -l ~/.config/marimo/marimo.toml
Ensure you have write permissions.Verify syntax:
# Correct
[keymap.overrides]
"cell.run" = "Cmd+Enter"

# Incorrect (missing quotes)
[keymap.overrides]
cell.run = Cmd+Enter
Restart marimo after manual config edits.

Build docs developers (and LLMs) love