cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

cat/module-path
012 / docs / reference / keys.md
keys.md 20.8K rendered
1---2title: "Keys and mouse"3sidebar_position: 24---56# Keys and mouse78Inside the grid, 012 behaves like Google Sheets: if you know a Sheets9shortcut, try it. Every command is also in the menus (F10 or Alt+letter)10and the command palette (Ctrl+K), which show each command's key. F1 or11Ctrl+/ lists every binding, generated from the table the app uses, so it12never drifts from what the keys do. This page is the same list with the13mouse and the vim keymap added.1415## Moving around1617| Key | Action |18|---|---|19| Arrows | Move one cell |20| Ctrl+arrows, End | Jump to the edge of the data (End: rightwards) |21| Tab, Shift+Tab | Right, left |22| PgUp, PgDn | A screen up, down |23| Alt+PgUp, Alt+PgDn | A screen left, right |24| Home, Ctrl+Home, Ctrl+End | Column A, cell A1, the last used cell |25| Ctrl+G, F5 | Go to a cell, a range, a named range, a [table](../sheets/tables.md) or a region's table (`r1` or `nu.r1`), on any sheet (`Sheet2!B3`) |2627## Entering data2829| Key | Action |30|---|---|31| Type | Replace the cell: `=` starts a formula, `'` forces text, and `$1,200`, `12%`, `9/26/2026` or `14:30` are numbers that keep their format ([Formulas](../formulas/README.md#what-you-type)) |32| Enter, Tab | Accept and move down or right; Enter goes back to the column a run of Tabs began in |33| Enter, F2, double-click | Edit the cell |34| Esc | Cancel the entry |35| Ctrl+Enter | Enter the same entry in every selected cell |36| Arrows, Shift+arrows | While typing a formula, after an operator: point at a cell, or a range |37| F4 | While typing a formula: cycle the reference at the caret through `A1`, `$A$1`, `A$1`, `$A1` |38| Ctrl+Left, Ctrl+Right (Option+arrows on macOS; Alt+arrows outside a cell) | While editing any text: move by word; in ENTER mode Ctrl+arrows commit and jump, as arrows do |39| Ctrl+Backspace, Option+Backspace, Ctrl+W; Alt+D, Ctrl+Delete | While editing any text: delete the word before the caret; the word after it |40| Ctrl+U, Cmd+Backspace | While editing any text: delete to the start of the line |41| Up, Down; Tab, Enter | While suggestions for a function, range or sheet name show: pick one; insert it (a sheet as `Summary!`, then arrows point into it). Esc hides them |4243## Selecting4445| Key | Action |46|---|---|47| Shift+arrows, Ctrl+Shift+arrows | Extend the selection, a cell at a time or to the edge of the data; the status line shows Sum, Avg and Count |48| Ctrl+Space, Shift+Space | Whole columns, whole rows |49| Ctrl+A | The data around the active cell, then everything |50| Esc | Deselect |5152## Changing the sheet5354| Key | Action |55|---|---|56| Del, Backspace | Clear the selection; formatting stays |57| Ctrl+Z; Ctrl+Y, Ctrl+Shift+Z | Undo; redo. In a workbook shared over `012 serve`, your own changes only ([Sharing a workbook](../terminal/ssh.md#sharing-a-workbook)) |58| Ctrl+C, Ctrl+X, Ctrl+V | Copy, cut, paste; references adjust as in Sheets, and copies also go to the system clipboard |59| Ctrl+Shift+V | Paste values only |60| Paste in the terminal | Tab-separated or multi-line text fills a block of cells |61| Ctrl+D, Ctrl+R | Fill down, fill right; a series started in the top rows (1, 2 over blanks) continues |62| Ctrl+Alt+=, Ctrl+Alt+- | Insert rows above, delete the selected rows (columns when whole columns are selected) |6364[Editing](../sheets/editing.md#copy-paste-and-fill) says how formats travel with65copies and which series the fill handle continues.6667## Formatting6869| Key | Action |70|---|---|71| Ctrl+Shift+1 | Number |72| Ctrl+Shift+2 | Time |73| Ctrl+Shift+3 | Date |74| Ctrl+Shift+4 | Currency |75| Ctrl+Shift+5 | Percent |76| Ctrl+Shift+6 | Scientific |77| Ctrl+B, Ctrl+I, Ctrl+U, Alt+Shift+5 | Bold, italic, underline, strikethrough |78| Ctrl+Shift+L, Ctrl+Shift+E, Ctrl+Shift+R | Align left, center, right |79| Alt+Shift+1, Alt+Shift+2, Alt+Shift+3, Alt+Shift+4 | Top, right, bottom, left border |80| Alt+Shift+7, Alt+Shift+6 | Outer borders, clear borders |81| Ctrl+\ | Clear formatting |8283The rest of the formats are in the Format menu.8485## Sheets8687| Key | Action |88|---|---|89| Ctrl+PgDn, Ctrl+PgUp, Alt+Right, Alt+Left | Next, previous sheet; while typing a formula, point into it to insert `Sheet2!A1` |90| Shift+F11 | New sheet |91| Alt+Shift+K | Go to a sheet by name |9293## Data tools9495| Key | Action | More |96|---|---|---|97| Ctrl+F, Ctrl+H | Find; find and replace | [Find and replace](../sheets/find-replace.md) |98| Alt+Down | Open the active cell's dropdown (type to search, Enter picks); elsewhere, with a filter on (Data > Create a filter), the column's filter (Space checks values, type to search, or pick a condition) | [validation](../sheets/rules.md#data-validation), [filter](../sheets/sort-filter.md#filter) |99| Space | Check or uncheck the selected checkboxes (Insert > Checkbox); elsewhere Space starts an entry | [Conditional formatting and data validation](../sheets/rules.md#data-validation) |100| Alt+, Alt+. | Trace precedents, dependents: highlight the cells a formula reads, or the formulas that read the cell, and jump to the first; again for the next, Esc to go back (Excel's Ctrl+[ and Ctrl+], which terminals send as Esc) | [Tracing formulas](../formulas/tracing.md#stepping-through-them) |101| Alt+; | Show precedents and dependents: mark them as the pointer moves and list them on the context line; again to stop | [Tracing formulas](../formulas/tracing.md) |102| Alt+' | Go to a precedent or dependent, picked from a list | [Tracing formulas](../formulas/tracing.md#going-to-one) |103| Alt+= | Evaluate formula: step through the active cell's formula one part at a time; Enter evaluates, → steps into a reference, ← steps out | [Tracing formulas](../formulas/tracing.md#evaluating-a-formula-step-by-step) |104| Alt+Shift+F | Frequency table of the active column on a new sheet, as VisiData's Shift+F | [Pivot tables](../sheets/pivots.md#frequency-tables) |105| Ctrl+Alt+T | Make the selection, or the data around the active cell, a table whose first row names its columns (Format > Convert to table) | [Tables](../sheets/tables.md) |106| Shift+F2 | Add or edit the active cell's note; Alt+Enter or Shift+Enter starts a new line | [Notes and protection](../sheets/notes-protection.md#notes) |107108Tools with no key of their own have their keys on screen while they're109open, and in their docs: sorting by several columns110([Freeze, sort and filter](../sheets/sort-filter.md#sort)), conditional formatting and data validation111([rules panel](../sheets/rules.md#conditional-formatting)), pivot tables112([pivot editor](../sheets/pivots.md)), protected ranges113([Notes and protection](../sheets/notes-protection.md#protected-sheets-and-ranges)), charts114([Charts](../sheets/charts.md)) and linked files (Data > Linked file, where115Enter keeps every row and L the last ones:116[Following files](../files/following.md)). In Data > Named ranges, Enter goes to a117range, F2 renames or repoints it and Ctrl+D deletes it; in Data > Table >118Tables, Enter goes to a table, F2 renames it and Ctrl+D removes it,119keeping its cells.120121## Files, menus and help122123| Key | Action |124|---|---|125| Ctrl+S, Ctrl+O, Ctrl+Q | Save, open (and import other formats), quit; with `012 --pipe`, quitting asks what to send, or sends what `--send` chose ([Pipelines](../nushell/pipelines.md#sending-it-on-012---pipe)) |126| F10, Alt+F, Alt+E, Alt+V, Alt+I, Alt+O, Alt+D, Alt+H | Open a menu; arrows move, Enter runs, Esc closes |127| Ctrl+K, Alt+/, Ctrl+Shift+P | Search the menus: find and run any command |128| Shift+F10, right-click | The cell, column or row menu |129| F1, Ctrl+/ | Keyboard shortcuts; F1 on a cell showing an error, or on a linked source's tab that can't be read, explains it in full ([Values and errors](../formulas/README.md#values-and-errors)) |130131In a workbook shared over `012 serve`, **File > Who's here** (or `who` in the132palette) lists the others and goes to one's cell, and **File > Hand over133writing** passes writing on in a one-writer room; neither has a key of134its own ([Sharing a workbook](../terminal/ssh.md#sharing-a-workbook)).135136With agents working in the session ([Live mode](../agents/live.md)):137138| Key | Action |139|---|---|140| Ctrl+Alt+A | Review suggestions: the agents' changes waiting for you |141| Up, Down (in the panel) | Go from suggestion to cell; the grid shows the cell |142| Enter, A (in the panel) | Accept the suggestion, or the cell, highlighted; click ✓ |143| R, Del (in the panel) | Reject it; click ✗ |144| Shift+A, Shift+R (in the panel) | Accept or reject every suggestion waiting |145| Enter, N, Esc (the agent's question) | Yes, no, cancel; a choice's number, or a value typed and Enter |146| Enter, A, Esc (the agent's request) | Allow once, allow for the session, deny |147148## Macros149150| Key | Action |151|---|---|152| Ctrl+Alt+Shift+0 to 9 | Run the macro with that shortcut ([Macros](../sheets/macros.md#running)) |153| Esc | Stop a macro while it runs (the mode indicator says CMD) |154155## Linked sources156157On a [linked source's](../files/sources.md#the-tab) tab (`SOURCE`) the158keys move and scroll as on a sheet, over every row of the source; Ctrl+G159and F5 go to a row, the sort and filter keys order the rows the tab160shows, and keys that would change cells say the tab is read-only.161162## Notebooks163164On a [notebook's](../nushell/notebooks.md#keys) tab, as in Jupyter:165command mode (`NOTEBOOK`) acts on cells, edit mode (`EDIT`) types into166one. **Data > Shell > Open notebook** opens the workbook's notebook;167on a sheet, `!` starts an entry as any character does.168169| Key | In command mode |170|---|---|171| Up, Down, `j`, `k`, Home, End, PgUp, PgDn | Move between cells and their outputs; on an output, Up and Down scroll its window first |172| Shift+Up, Shift+Down, `K`, `J` | Select the cells passed over too, to run, delete, copy or move together |173| Alt+Up, Alt+Down, Ctrl+Shift+Up, Ctrl+Shift+Down | Move the selected cells up or down |174| Enter | Edit the cell; on a table or record output, work in its grid; on another output, open it full-screen |175| Shift+Enter, Ctrl+Enter, `r`, Alt+Enter | Run the cells and select the next; run them in place (`r` too); run them and add a cell under them |176| F9 | Run every cell |177| `a`, `b`, `!` | Add a code cell above, below; add one below and edit it |178| `dd`, `z` | Delete the selected cells; undo |179| `m`, `y` | Make the cells notes, or code |180| `c`, `x`, `v`, `V` | Copy, cut the cells; paste below, above |181| `o`, `O` | Hide the output, or show it again; show all of it rather than a window |182| `n`, `G` | Name the cell; send the output to a sheet |183| Ctrl+G | Go to a cell by its number, name, code or heading |184| `f` | Run the cell as a stream, its rows arriving as the pipeline prints them |185| `ii`, `00` | Stop what's running, streams too; restart, clearing every output |186187| Key | In edit mode |188|---|---|189| Esc | Back to command mode, keeping what was typed |190| Shift+Enter, Ctrl+Enter, Alt+Enter | Run, as in command mode |191| Enter, Tab | A new line; complete the word at the caret, with what nu completes there ([Writing a cell](../nushell/notebooks.md#writing-a-cell)) |192| F1 | The help of the nushell command at the caret, with its page in nushell's docs; the shortcuts where there's none |193| Up, Down, Home, End, Ctrl+A, Ctrl+E | Move by the lines on screen; the start, the end of the line |194| Word keys | As [anywhere text is edited](#entering-data); Ctrl+U deletes to the start of the line, not the cell |195196| Key | In a table's or record's output ([its grid](../nushell/notebooks.md#outputs-as-grids)) |197|---|---|198| Arrows, Shift+arrows, Ctrl+arrows, PgUp, PgDn, Ctrl+A | Move and select, as [on a sheet](#selecting); the status line shows Sum, Avg and Count |199| Ctrl+C | Copy the selection, to paste on a sheet or elsewhere |200| Ctrl+F | Find in the output |201| Alt+Down | With a filter on (Data > Create a filter), the column's filter |202| Ctrl+Z, Ctrl+Y | Undo, redo a sort, a filter or a column's width |203| Enter | Show the grid full-screen |204| Esc | Deselect; then back from full-screen, then back to the notebook |205206| Key | On any other output full-screen |207|---|---|208| Up, Down, `j`, `k`, PgUp, PgDn, `g`, `G` | Move |209| Esc, `q` | Back to the notebook |210211## Keys the terminal has to tell apart212213Terminals send some keys as they send others: Shift+Enter as Enter,214Ctrl+I as Tab, Ctrl+M as Enter, and Alt and a letter as Esc typed just215before the letter. A terminal with the kitty keyboard protocol216([Terminal features](../terminal/README.md#terminal-features-012-uses))217tells them apart and says when a key is let go, and there 012 also does:218219| Key | Action | Where the terminal can't tell |220|---|---|---|221| Shift+Enter | Accept an entry and move up, as in Sheets | As Enter: accept and move down |222| Ctrl+I | Italic | As Tab: move right |223| Shift+Enter, Ctrl+Enter | In a notebook, run the cell (and select the next) | As Enter: edit the cell, or a new line in it; Esc then `r` runs it, and Alt+Enter runs it and adds a cell under it |224| Space, held | On a selected chart, show it across the grid until Space is let go; in File > Settings > Theme with nothing typed, hide the list to see the whole sheet in the highlighted theme | Space does what it does there: deselects the chart and starts an entry, or types a space |225226## Vim keys227228File > Settings > Vim keys (also `:settings.vim` or the palette) turns229on a vim keymap in the spirit of sc-im and VisiData. It is off by230default and belongs to you, not the sheet: it's kept in the config file231as `keymap = vim` ([Configuration](config.md#keymap)), never in `.012` files.232The mode indicator says **NORMAL** where it would say READY, and233typing into a cell is ENTER or EDIT, as always:234235```mermaid236stateDiagram-v2237 [*] --> NORMAL238 NORMAL --> VISUAL: v, V239 VISUAL --> NORMAL: v, V, Esc240 NORMAL --> COMMAND: #58;241 VISUAL --> COMMAND: #58;, on the selection242 COMMAND --> NORMAL: Enter, Esc243 NORMAL --> EDIT: i, a, Enter244 NORMAL --> ENTER: =, o, O, s, cc, S245 EDIT --> NORMAL: Enter, Tab, Esc246 ENTER --> NORMAL: Enter, Tab, Esc247```248249Keys vim doesn't take keep their Sheets meaning250(arrows, Del, Ctrl+S, Ctrl+C and Ctrl+V, Alt+letter menus, F-keys);251Ctrl+D, Ctrl+U and Ctrl+R are vim's, so fill down and fill right are in252the Edit menu. F1 lists the vim keys first, and the menus and palette253show them where Sheets' keys are taken.254255![Vim keys: counts, dd and p, / search, VISUAL rows and the : line](../media/vim.gif)256257| Keys (NORMAL) | Action |258|---|---|259| `h` `j` `k` `l`, arrows | Left, down, up, right |260| `w` `b` | Jump to the edge of the data, right or left (as Ctrl+arrows) |261| `gg` `G` | First row, last row with data; with a count, that row (`12G`) |262| `0` `^` `$` | Column A, the last filled cell of the row |263| `H` `M` `L` | Top, middle, bottom row on screen |264| Ctrl+D, Ctrl+U | Half a screen down, up |265| A count (`5j`, `3dd`, `4x`) | Repeats a move or command, or says how many rows or cells an operator takes |266| `i` `a`, Enter | Edit the cell, caret at the start or the end |267| `=` | Start a formula |268| `o` `O` | Insert a row below or above and start typing in it |269| `x` | Clear the cell, keeping a copy to paste (with a count, that many to the right) |270| `s` | Clear the cell and start typing in it |271| `dd` `yy` | Cut or copy the row (with a count, that many rows) |272| `cc` `S` | Clear the row's cells, keeping the row and its formats and a copy to paste, and start typing in the active cell |273| `p` `P` | Paste rows cut or copied with `dd` or `yy` as new rows below or above, with their row formats; other copied cells paste at the active cell |274| `.` | Repeat the last change: `x`, `s`, `dd`, `cc`, `p`, `o`, or an edit begun with `i`, `a` or `=` with what was typed; a count replaces the change's own (`3.`) |275| `"a` to `"z`, `"0` to `"9`, `"-`, `"+` | Name the register the next `yy`, `dd`, `x`, `p` or VISUAL `y`, `d`, `p` uses (see [Registers](#registers)) |276| `ma` to `mz` | Mark the active cell |277| `` `a `` to `` `z ``, `'a` to `'z` | Go to the mark, or to its row in column A (on the mark's sheet) |278| `''` ``` `` ``` | Back to where the last jump (`gg`, `G`, `H`, `M`, `L`, `/`, `n`, `N`, a mark, a `:` cell or row) left from |279| `u`, Ctrl+R | Undo, redo |280| `v` `V` | Select cells or whole rows (VISUAL); motions stretch the selection |281| `/`, `n` `N` | Find (Enter stays on the match), next and previous match |282| `gt` `gT` | Next, previous sheet |283| `:` | The command line |284| Esc | Cancel a count or sequence, leave VISUAL, deselect |285286| Keys (VISUAL) | Action |287|---|---|288| `d` `x` | Delete the selection (whole rows with `V`, the cells' contents with `v`), keeping a copy to paste |289| `y` | Copy the selection |290| `p` | Paste over the selection |291| `o` | Go to the other corner |292| `:` | The command line, acting on the selection |293| `v` `V`, Esc | Back to NORMAL |294295### Registers296297Copies and deletes go to the clipboard Ctrl+V pastes, which is vim's298unnamed register (`""`), and also to a register of their own:299300| Register | Holds |301|---|---|302| `"a` to `"z` | What the operator after it copied or deleted (`"ayy`, `"bx`), until written again; `"ap` pastes it |303| `"0` | The last copy made without naming a register |304| `"1` to `"9` | The last rows deleted (`dd`, `cc`, VISUAL `V` `d`), the newest in `"1` |305| `"-` | The last cells deleted (`x`, `s`, VISUAL `v` `d`) |306| `"+` | The system clipboard: every copy goes there (OSC 52), and `"+p` pastes what the terminal reads back from it, where the terminal allows reading it |307308Rows in a register paste as new rows, as they do after `dd` and `yy`.309Registers and marks belong to the workbook open, as the clipboard does.310311### The command line312313The `:` line takes:314315| Command | Action |316|---|---|317| `:B12`, `:Sheet2!A1`, `:C3:D9`, `:Sales` | Go to a cell, range or named range |318| `:40` | Go to row 40 |319| `:w`, `:w name`, `:w out.csv` | Save, Save as, or Download as another format, as the File menu does |320| `:w!`, `:w! name`, `:wq!` | Save even if the file changed on disk since it was opened, and replace a file of the name given, without asking (as choosing Overwrite or Replace would) |321| `:q`, `:q!` | Quit (asking about unsaved changes), quit discarding them; with `012 --pipe`, `:q` quits as Ctrl+Q does and `:q!` quits without sending |322| `:wq`, `:x` | Save and quit; `:x` saves only if something changed |323| `:e name`, `:e!` | Open a sheet or import a file; refused with unsaved changes unless `:e!` |324| `:edit.fill_down`, `:fill down` | Any command, by its id or title |325326Completions for commands appear under the line as you type, drawn from327the same registry as the menus and palette: Tab puts the highlighted328one on the line (Tab again for the next, Shift+Tab back), Ctrl+N and329Ctrl+P move, and Enter runs the line, or the highlighted completion when330the line isn't a command itself (`:fill d` Enter fills down). Up and331Down go back and forth through the lines run before, as in vim: only332those starting with what's typed (`:w` Up finds the last `:w` line).333The history lasts until 012 closes, each `012 serve` session keeping its334own.335336## Mouse337338| Gesture | Action |339|---|---|340| Click, drag, Shift+click | Select a cell, a range, or extend the selection; dragging past the edge scrolls |341| Click a column or row header, or the corner | Select whole columns, rows, or everything |342| Double-click | Edit the cell |343| Drag the fill handle (▟ at the selection's corner, shown on hover) | Continue a series (1, 2, 3; Jan, Feb; Mon, Tue; dates; Item 1, Item 2) or copy |344| Drag a column header's right edge; double-click it | Resize the column; fit it to its contents |345| Drag the bottom-right corner of a row number (`▄` on hover); double-click it | Resize the row; fit it to its contents |346| Right-click | The cell, column or row menu |347| Click `▾` in a header, or in a cell | Open the column's filter, or the cell's dropdown |348| Click a checkbox | Check or uncheck it |349| Click a chart; drag it or its corner | Select it; move or resize it (then arrows move it, Shift+arrows resize, Enter edits, Del deletes) |350| Cmd- or Ctrl-click a link | Open a URL in a cell or a `=HYPERLINK(url, [label])` |351| Hover a cell with a note | Show the note beside it |352353On a notebook's tab, as in JupyterLab:354355| Gesture | Action |356|---|---|357| Click a cell; Shift+click | Select it; select the cells between too |358| Click in a code cell's box; double-click a note | Edit it, the caret where you clicked |359| Click `▶` (`■` while it runs) | Run the cell (stop it) |360| Click an output; double-click it | Select it (in a table's or record's grid, the cell clicked, to work in it); open it full-screen |361| Drag in an output's grid; drag its column header's right edge | Select cells; resize the column |362| Click left of an output | Hide it, or show it again |363| Wheel over an output's window | Scroll the output, then the notebook |364| Click a toolbar button | Run, stop, restart, run all, add, cut, copy, paste, or pick the cell's kind |365| Right-click a cell | The cell menu |366367The sheet tabs take the mouse too: see [sheets and tabs](../sheets/sheets-and-tabs.md).368While typing a formula, clicking a cell or a tab points at it, as in369Sheets.370371The pointer changes shape over cells, resize handles and the formula bar372in terminals that support it (OSC 22). In Ghostty and xterm, Shift+click373normally starts the terminal's own text selection; 012 asks the terminal374to pass it through (XTSHIFTESCAPE) and restores that on exit.