From 93c2a6d862df215039c0a2c9545ee89c4858fc98 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 23 Nov 2026 16:00:01 -0300 Subject: help: the words of panes and columns documented for a user (item 5's third group: `New`, `Newcol`, `Del`, `DelAbove`, `DelBelow`, `Delcol`, `Joincol`, `Collapse`, `Zerox`, `Get`, `Save`, `Mode`, `Togglettymode`, `Left`, `Down`, `Up`, `Right`; `Follow`, `Unfollow`, `Undock`, `Window` and `Putall` as the table's change wrote them), each sentence checked against its run (core/builtins.zig, core/layout.zig `newColumn` and `placeNew`, core/keys.zig `cycleMode` and `toggleTty`, core/exec.zig `saveTo`): New (it takes the keyboard; Save asks it for a path; past 100 bytes Exit, Del and Restore ask about it), Newcol (the next pane made there goes in it; refused, saying why), Del (`Del k`, `Del j`, the question on the notice band from the keyboard between two panes, a docked pane's rows to the pane it answers for, the refusal once over unsaved text), DelAbove and DelBelow (as `Del k`, `Del j`), Delcol (the tag's column, else the pane's; refused once), Joincol (when it is refused), Collapse, Zerox (only a file's pane), Get (`Get `; a directory's pane read again), Save (`Save `; a pane with no file of its own asks; a revision is written only to a path; the warning once over a file changed on disk), Mode (normal, insert, and in a terminal raw, then normal), Togglettymode, the four moves; was: Get and Zerox opening on "acme's"; docs/typ/builtins-tui.json regenerated Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/builtins.zig | 68 +++++++++++++++++++++++++++++++++------------- docs/typ/builtins-tui.json | 28 +++++++++---------- 2 files changed, 63 insertions(+), 33 deletions(-) diff --git a/core/builtins.zig b/core/builtins.zig index 5c29bf59..64ebe5f0 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -962,9 +962,11 @@ pub const ClipReplace = struct { // ---- panes and columns ---- -/// acme's Get: the pane's file read again, its unsaved edits refused once -/// as Del refuses them. `Get file` loads that file into the pane instead, -/// the pane taking its name. +/// Read this pane's file again from disk; refused once over unsaved edits, as +/// Del is. +/// +/// `Get ` loads that file into the pane instead, the pane taking its +/// name. In a directory's pane, it reads the directory again. pub const Get = struct { pub const takes_arg = true; pub fn run(c: Ctx) void { @@ -1099,7 +1101,8 @@ pub const Plumb = struct { /// Open a second pane on this pane's file: the same text, undo and unsaved /// state. /// -/// Each pane keeps a scroll and a cursor of its own. +/// Each pane keeps a scroll and a cursor of its own. Only a file's pane takes +/// it. pub const Zerox = struct { // acme's Zerox (File.zerox). pub fn run(c: Ctx) void { @@ -1113,6 +1116,11 @@ pub const Zerox = struct { }; /// Write the pane's text to its file, or to the file its argument names. +/// +/// `Save ` writes it there. Bare, a pane with no file of its own (a +/// +New, a list, a terminal) asks for a path; a file at a revision is +/// read-only, written only to a path. Over a file changed on disk since it +/// was read, it warns once. pub const Save = struct { pub const takes_arg = true; pub fn run(c: Ctx) void { @@ -1144,7 +1152,10 @@ pub const Save = struct { } }; -/// Open an empty scratch pane, /+New, in this pane's directory. +/// Open an empty scratch pane, +New, in this pane's directory. +/// +/// It takes the keyboard. Save asks it for a path to write to; past 100 +/// bytes, Exit, Del and Restore ask about its text as about a file's. pub const New = struct { pub const output: OutputTraits = .{ .name = config.scratch_buffer, .doc = true, .saves = true }; pub fn run(c: Ctx) void { @@ -1152,7 +1163,10 @@ pub const New = struct { } }; -/// An empty column right of the keyboard's, its tag taking the keyboard. +/// Make an empty column right of the keyboard's, its tag taking the keyboard. +/// +/// The next pane made from there goes in it. Refused, saying why, when no +/// column fits. pub const Newcol = struct { pub const scope: Scope = .session; pub fn run(c: Ctx) void { @@ -1160,9 +1174,13 @@ pub const Newcol = struct { } }; -/// Close the pane. `Del k` gives its rows to the open pane above it and -/// `Del j` to the one below, each falling back to the other side. Focus on -/// it goes with its rows. +/// Close the pane. +/// +/// `Del k` gives its rows to the pane above it, `Del j` to the one below, +/// each falling back to the other side; bare, from the keyboard between two +/// panes, it asks k or j on the pane's notice band. A docked pane's rows go +/// back to the pane it answers for. Refused once while the pane holds unsaved +/// text (listed in +Unsaved); Del again, nothing edited since, closes it. pub const Del = struct { pub const takes_arg = true; pub fn run(c: Ctx) void { @@ -1305,7 +1323,11 @@ pub const Diff = struct { pub const run = @import("hunks.zig").word; }; -/// Cycle the pane's input modes: terminals add raw tty mode to normal/insert. +/// Step this pane to its next input mode: normal, insert, and in a terminal +/// raw. +/// +/// From the last it goes back to normal. The keyboard goes to the pane's +/// text. pub const Mode = struct { pub fn run(c: Ctx) void { if (c.pane.file == null and !c.pane.isTerminal()) return c.p.reportFailure(c.id, "Mode: only a text or terminal pane has modes"); @@ -1313,7 +1335,8 @@ pub const Mode = struct { } }; -/// Switch this terminal between raw program input and normal editor mode. +/// Switch this terminal between raw mode, its keys the program's, and normal +/// mode. pub const Togglettymode = struct { pub const needs: PaneKind = .terminal; pub fn run(c: Ctx) void { @@ -1358,7 +1381,7 @@ pub const Redo = struct { } }; -/// Fold a pane to its tag, or restore its share of the column. +/// Fold this pane to its tag, or give it its share of the column again. pub const Collapse = struct { pub fn run(c: Ctx) void { layout.toggleCollapse(c.p, c.id); @@ -1376,7 +1399,11 @@ pub const Undock = struct { } }; -/// Close this column and its panes, refusing once over unsaved text. +/// Close this column and its panes. +/// +/// The column is the one whose tag it ran from, else the pane's. Refused once +/// while a pane in it holds unsaved text, the notice saying how many; Delcol +/// again, nothing edited since, closes them. pub const Delcol = struct { pub fn run(c: Ctx) void { // The column of the tag it came from, else the pane's: a pane ctl's @@ -1389,14 +1416,14 @@ pub const Delcol = struct { } }; -/// Close the pane, giving its rows to the pane above it. +/// Close the pane, giving its rows to the pane above it, as `Del k` does. pub const DelAbove = struct { pub fn run(c: Ctx) void { Del.run(.{ .p = c.p, .pane = c.pane, .id = c.id, .txt = c.txt, .arg = "k" }); } }; -/// Close the pane, giving its rows to the pane below it. +/// Close the pane, giving its rows to the pane below it, as `Del j` does. pub const DelBelow = struct { pub fn run(c: Ctx) void { Del.run(.{ .p = c.p, .pane = c.pane, .id = c.id, .txt = c.txt, .arg = "j" }); @@ -1508,8 +1535,10 @@ pub const Repl = struct { } }; -/// Fold the active pane's column into the one on its right, keeping its panes. -/// The horizontal mirror of the vertical stacking `New` does. +/// Fold the keyboard's column into the one on its right, keeping its panes. +/// +/// Refused for the last column, and where the joined column could not give +/// each pane its tag and 2 rows. pub const Joincol = struct { pub const scope: Scope = .session; pub fn run(c: Ctx) void { @@ -1787,7 +1816,7 @@ pub const Left = struct { } }; -/// Move the keyboard to the pane below, off a tag onto the pane under it. +/// Move the keyboard to the pane below, or off a tag onto the pane under it. pub const Down = struct { pub fn run(c: Ctx) void { if (c.p.view().header != null) { @@ -1806,7 +1835,8 @@ pub const Down = struct { } }; -/// Move the keyboard to the pane above, and from a column's top pane to its tag. +/// Move the keyboard to the pane above, and from a column's top pane to its +/// tag. pub const Up = struct { pub fn run(c: Ctx) void { if (c.p.view().header != null) { diff --git a/docs/typ/builtins-tui.json b/docs/typ/builtins-tui.json index 233588ae..43140f77 100644 --- a/docs/typ/builtins-tui.json +++ b/docs/typ/builtins-tui.json @@ -18,19 +18,19 @@ {"name": "ClipYank", "leader": "SPC y", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Copy the selection to the system clipboard.", "text": "Copy the selection to the system clipboard."}, {"name": "ClipYankMain", "leader": "SPC Y", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "helix `Y`: the PRIMARY selection alone, where `SPC y` joins every cursor's.", "text": "helix `Y`: the PRIMARY selection alone, where `SPC y` joins every cursor's. One cursor makes them the same word."}, {"name": "CodeAction", "leader": "SPC l a", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "List the language server's code actions for the cursor.", "text": "List the language server's code actions for the cursor."}, - {"name": "Collapse", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Fold a pane to its tag, or restore its share of the column.", "text": "Fold a pane to its tag, or restore its share of the column."}, + {"name": "Collapse", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Fold this pane to its tag, or give it its share of the column again.", "text": "Fold this pane to its tag, or give it its share of the column again."}, {"name": "Compare", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Draw the file's difference between each two jj revisions as one change, as Changes draws one.", "text": "Draw the file's difference between each two jj revisions as one change, as Changes draws one.\n`Compare [ ...]`: two points or more in their order, each one revision (a commit or change id, a bookmark, `master@origin`, `@`): `Compare 9ef6312813 ea63317630 master@origin`. A pair is one change however many lie between its points, its row after its last line `from..to N changes dates`. One set a pane: a later Changes or Compare replaces it. Bare: as bare Changes."}, {"name": "Config", "leader": "SPC f c", "also": ["topbar"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Open the startup file, `init` in the configuration directory, in a pane.", "text": "Open the startup file, `init` in the configuration directory, in a pane.\nIts pane when it is open, else the file; not there yet, a pane of that name, which Save makes, its directory too."}, {"name": "Debug", "leader": "SPC t d", "also": ["topbar"], "arg": true, "scope": "root", "setting": true, "choices": "on, off", "doc": "A small box of frame statistics at the top right, on or off.", "text": "A small box of frame statistics at the top right, on or off."}, {"name": "Def", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Go to the definition of the symbol under the cursor.", "text": "Go to the definition of the symbol under the cursor.\nWith an argument (a 2-1 chord's selection), of that symbol, where it is nearest."}, - {"name": "Del", "leader": "SPC d", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Close the pane.", "text": "Close the pane. `Del k` gives its rows to the open pane above it and `Del j` to the one below, each falling back to the other side. Focus on it goes with its rows."}, - {"name": "DelAbove", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close the pane, giving its rows to the pane above it.", "text": "Close the pane, giving its rows to the pane above it."}, - {"name": "DelBelow", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close the pane, giving its rows to the pane below it.", "text": "Close the pane, giving its rows to the pane below it."}, - {"name": "Delcol", "leader": "SPC c d", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close this column and its panes, refusing once over unsaved text.", "text": "Close this column and its panes, refusing once over unsaved text."}, + {"name": "Del", "leader": "SPC d", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Close the pane.", "text": "Close the pane.\n`Del k` gives its rows to the pane above it, `Del j` to the one below, each falling back to the other side; bare, from the keyboard between two panes, it asks k or j on the pane's notice band. A docked pane's rows go back to the pane it answers for. Refused once while the pane holds unsaved text (listed in +Unsaved); Del again, nothing edited since, closes it."}, + {"name": "DelAbove", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close the pane, giving its rows to the pane above it, as `Del k` does.", "text": "Close the pane, giving its rows to the pane above it, as `Del k` does."}, + {"name": "DelBelow", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close the pane, giving its rows to the pane below it, as `Del j` does.", "text": "Close the pane, giving its rows to the pane below it, as `Del j` does."}, + {"name": "Delcol", "leader": "SPC c d", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close this column and its panes.", "text": "Close this column and its panes.\nThe column is the one whose tag it ran from, else the pane's. Refused once while a pane in it holds unsaved text, the notice saying how many; Delcol again, nothing edited since, closes them."}, {"name": "Detach", "leader": "SPC s D", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Detach this pardes from its terminal or window, leaving the session running.", "text": "Detach this pardes from its terminal or window, leaving the session running.\n`pardes attach` (or `pardes-gui attach`) shows it again, as a client."}, {"name": "Diagnostics", "leader": "SPC l d", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "List the file's diagnostics from the language server.", "text": "List the file's diagnostics from the language server."}, {"name": "Diff", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Show a diff's hunks stacked in a +Diff, each under its place, as a diff viewer shows them.", "text": "Show a diff's hunks stacked in a +Diff, each under its place, as a diff viewer shows them.\nBare, on a diff (a .diff, a .patch, a +Pager holding one): its hunks stacked; on a +Diff: the diff itself, as text. `Diff `: that .diff's or .patch's hunks. `Diff ` (7 to 40 hex digits): `git show` of that commit, in its own `+Diff-`. `Diff [path[:line]]` (a jj change id): its patch, its header and whole message on top, the cursor at that place. `Diff .. [path[:line]]`: the difference between two points, the changes between them on top.\nEach hunk stands under its `path:line` and the declarations around it, a + or - before each line, the words a changed line changed tinted. `SPC j n` and `SPC j p` step through the hunks; B3 on a place opens it."}, - {"name": "Down", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Move the keyboard to the pane below, off a tag onto the pane under it.", "text": "Move the keyboard to the pane below, off a tag onto the pane under it."}, + {"name": "Down", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Move the keyboard to the pane below, or off a tag onto the pane under it.", "text": "Move the keyboard to the pane below, or off a tag onto the pane under it."}, {"name": "Dump", "leader": "SPC s d", "also": ["topbar"], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Write the session's panes and layout to the state file, for Restore.", "text": "Write the session's panes and layout to the state file, for Restore.\n`Dump export ` writes them to a file of their own instead."}, {"name": "DumpConfig", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Open the settings in effect, each a word to click, and the startup file's path.", "text": "Open the settings in effect, each a word to click, and the startup file's path."}, {"name": "DumpDir", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": null, "doc": "The directory of the state file, where Dump writes and Recent is kept.", "text": "The directory of the state file, where Dump writes and Recent is kept. A relative Restore name is looked for there too; bare, the default."}, @@ -42,7 +42,7 @@ {"name": "Find", "leader": "SPC f f", "also": ["topbar"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "List the files below this pane's directory whose names match its argument.", "text": "List the files below this pane's directory whose names match its argument.\nA query pane under this pane, its line 1 `Find `, the files under it by a fuzzy match of their names: with a word, listed, the keyboard left where it was; bare (`SPC f f`), typed into. Enter or B3 on a row opens that file. A script's Find that finds nothing fails, `not found`."}, {"name": "Follow", "leader": "SPC c f", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Show one text across a chain of panes as consecutive pages, scrolled as one.", "text": "Show one text across a chain of panes as consecutive pages, scrolled as one.\nAs Emacs's follow-mode: each page goes on where the one before ends. Each Follow adds a page, a Zerox of the text, at the end of the column right of the chain's last, or in a new column there; its tag has Unfollow."}, {"name": "Forward", "leader": "SPC j i", "also": ["C-i"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Ctrl-i: one step forward again, up to wherever Back started.", "text": "Ctrl-i: one step forward again, up to wherever Back started."}, - {"name": "Get", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "acme's Get: the pane's file read again, its unsaved edits refused once as Del refuses them.", "text": "acme's Get: the pane's file read again, its unsaved edits refused once as Del refuses them. `Get file` loads that file into the pane instead, the pane taking its name."}, + {"name": "Get", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Read this pane's file again from disk; refused once over unsaved edits, as Del is.", "text": "Read this pane's file again from disk; refused once over unsaved edits, as Del is.\n`Get ` loads that file into the pane instead, the pane taking its name. In a directory's pane, it reads the directory again."}, {"name": "Grep", "leader": "SPC f g", "also": ["topbar"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "List the lines of the files below this pane's directory that hold its argument.", "text": "List the lines of the files below this pane's directory that hold its argument.\nThe text is matched as it is, not as a pattern, in a query pane under this pane, its line 1 `Grep `: with a word, listed, the keyboard left where it was; bare (`SPC f g`), typed into. Past 2000 lines it stops, and More goes on. A script's Grep that finds nothing fails, `not found`."}, {"name": "Help", "leader": "SPC ?", "also": ["topbar"], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Show every builtin with its keys and documentation, or one builtin's alone.", "text": "Show every builtin with its keys and documentation, or one builtin's alone.\n`Help `: that builtin alone, its keys spelled out, what it acts on and its line for a shell (`Help Diff`); a setting or an addon's word the same. `Help `: the builtins under SPC and those keys (`Help l`, as `SPC l ?` shows them). Each fills the one +Help: a second Help replaces its text."}, {"name": "History", "leader": "SPC f h", "also": ["topbar"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "List the state file's dumps, newest first, each with the Restore that brings it back.", "text": "List the state file's dumps, newest first, each with the Restore that brings it back.\nThose Dump made and those every session's end left: each a `Restore