Maas Lalani 8879249468 Cherry pick Helix style config (#67)
* feat: configurable keybindings via Helix-style TOML config

Refactor hardcoded switch statements into action-based dispatch with
per-mode keymaps. Users can override bindings via
$XDG_CONFIG_HOME/sheets/config.toml using [keys.normal], [keys.insert],
and [keys.select] tables. Set a key to "nop" to disable it.

* feat: add delete_selection action for visual mode

Clear selected cells without affecting clipboard/registers.
Default bound to D in select mode. Complements cut_selection (x)
which yanks before clearing.

* feat: goto overlay with visual cell coordinate filtering

When g is pressed, all visible cells show their coordinates (column
letters in blue, row numbers in yellow) centered over dimmed cell
content. Typing filters matches live — matched chars dim, unmatched
stay bright. Auto-selects when one visible cell remains.

Fully matched cells show ⏎ symbol to indicate enter confirmation.
Visual indicators: GOTO mode label in status bar, dimmed grid borders,
colored row/column headers for matching axes, input prompt at bottom.

* fix(goto): keep overlay pending after unique-match jump

autoSelectGoto finalized on a unique visible match, killing the
overlay before it ever rendered — the integration test encoded the
intended UX (persistent gA5 label, next non-ref key exits and acts).
Jump still happens live; escape/enter/other keys end the pending
state. Unskips the April integration test.

---------

Co-authored-by: Adrian Galilea <adriangalilea@gmail.com>
2026-07-15 22:36:26 -07:00
2026-04-02 05:36:38 -07:00
2026-04-02 15:33:26 +02:00
2026-04-02 05:36:38 -07:00
2026-07-15 22:36:26 -07:00
2026-07-15 22:36:26 -07:00
2026-04-01 01:38:04 -07:00
2026-04-01 16:30:30 -07:00
2026-07-15 22:36:26 -07:00

Sheets

Spreadsheets in your terminal.


demo


Command Line Interface

Launch the TUI

> sheets budget.csv

Read from stdin:

> sheets <<< ID,Name,Age
1,Alice,24
2,Bob,32
3,Charlie,26

Read a specific cell:

> sheets budget.csv B9
2760

Or, range:

> sheets budget.csv B1:B3
1200
950
810

Modify a cell:

> sheets budget.csv B7=10 B8=20

Navigation

  • h, j, k, l: Move the active cell
  • gg, G, 5G, gB9: Jump to the top, bottom, a row number, or a specific cell
  • 0, ^, $: Jump to the first column, first non-empty column, or last non-empty column in the row
  • H, M, L: Jump to the top, middle, or bottom visible row
  • ctrl+u, ctrl+d: Move half a page up or down
  • zt, zz, zb,: Align the current row to the top, middle, or bottom of the window
  • /, ?: Search forward or backward
  • n, N: Repeat the last search
  • ma, 'a: Set a mark and jump back to it later
  • ctrl+o, ctrl+i: Move backward or forward through the jump list
  • q, ctrl+c: Quit

Editing & Selection

  • i, I, c: Edit the current cell, edit from the start, or clear the cell and edit
  • ESC: Leave insert, visual, or command mode
  • enter, tab, shift+tab: In insert mode, commit and move down, right, or left
  • ctrl+n, ctrl+p: In insert mode, commit and move down or up
  • o, O: Insert a row below or above and start editing
  • v, V: Start a visual selection or row selection
  • y, yy: Copy the current cell, or yank the current row(s)
  • x, p: Cut the current cell or selection, and paste the current register
  • dd: Delete the current row
  • u, ctrl+r, U: Undo and redo
  • .: Repeat the last change

Visual Mode

  • =: In visual mode, insert a formula after the selected range =|(B1:B8).

Command Mode

Press : to open the command prompt, then use commands such as:

  • :w to save
  • :w path.csv to save to a new file
  • :e path.csv to open another CSV
  • :q or :wq to quit
  • :goto B9 or :B9 to jump to a cell

Configuration

Keybindings can be customized via a Helix-style TOML config file at ~/.config/sheets/config.toml (or $XDG_CONFIG_HOME/sheets/config.toml).

[keys.normal]
"C-c" = "quit"
"C-s" = "command_prompt"

[keys.insert]
"C-c" = "commit_down"

[keys.select]
"d" = "cut_selection"

Each section maps a key to an action name. Only specify the bindings you want to override — unset keys keep their defaults. Set a key to "nop" to disable it.

Available actions

Navigation

Action Description
move_left Move one cell left
move_right Move one cell right
move_up Move one cell up
move_down Move one cell down
move_to_first_col Jump to first column
move_to_first_nonempty_col Jump to first non-empty column
move_to_last_nonempty_col Jump to last non-empty column
move_to_window_top Jump to top visible row
move_to_window_middle Jump to middle visible row
move_to_window_bottom Jump to bottom visible row
scroll_half_up Scroll half page up
scroll_half_down Scroll half page down
goto_pending Start goto cell input
goto_bottom Jump to last row
jump_forward Jump list forward
jump_backward Jump list backward

Editing

Action Description
enter_insert Edit current cell
enter_insert_start Edit from start of cell
change_cell Clear cell and edit
delete_pending Start delete row
open_col_after Insert column after and edit
open_col_before Insert column before and edit
open_row_below Insert row below and edit
open_row_above Insert row above and edit
yank Copy cell
cut Cut cell
paste Paste
undo Undo
redo Redo
repeat_change Repeat last change
toggle_bold Toggle bold formatting

Mode

Action Description
quit Quit
command_prompt Open command prompt
search_forward Search forward
search_backward Search backward
search_next Next search match
search_prev Previous search match
enter_select Enter visual select
enter_row_select Enter row select
register_pending Select register
mark_set Set mark
mark_jump Jump to mark
mark_jump_exact Jump to mark (exact)
align_pending Start alignment command

Select mode

Action Description
copy_selection Copy selection
copy_selection_ref Copy selection as reference
cut_selection Cut selection
delete_selection Clear selection without affecting clipboard
formula_from_selection Insert formula from selection
toggle_row_select Toggle row selection
toggle_selection_bold Toggle bold on selection

Insert mode

Action Description
commit_down Commit and move down
commit_right Commit and move right
commit_left Commit and move left
commit_up Commit and move up
cursor_left Move cursor left
cursor_right Move cursor right
cursor_home Move cursor to start
cursor_end Move cursor to end
delete_at_cursor Delete at cursor
delete_before_cursor Delete before cursor
delete_to_start Delete to start
delete_to_end Delete to end
delete_word_before Delete word before cursor
insert_space Insert space

Key notation: C-x for Ctrl+x, S-tab for Shift+Tab, ret for Enter, space, backspace, del, esc, up/down/left/right, home/end, tab. Literal characters like h, j, :, / are written as-is.

Installation

Install with Homebrew on macOS or Linux:

brew install sheets

Or install with Go:

go install github.com/maaslalani/sheets@main

Or download a binary from the releases.

License

MIT

Feedback

I'd love to hear your feedback on improving sheets.

Feel free to reach out via:


zzz

S
Description
No description provided
Readme MIT 1,006 KiB
Languages
Go 99.5%
Nix 0.5%