From 3dfa6a9d9a788e89291efb035327cd181c196749 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 23 Nov 2026 16:05:56 -0300 Subject: help: the rest of the builtins documented for a user (item 5's eighth group: `NextColor`, `Themes`, `ThemeFile`, `DumpThemes`, `Fonts`, `TreeContext`, `Palette`, `Ascii`, the five clipboard words, `Tutor`, `DumpConfig`, `LocationsConfig`, `Messages`, `Mini`, `Back`, `Forward`, `Last`, `Jumplist`, `Edit`, `Undo`, `Redo`; `Help`, `Config`, `Build`, `Changelog`, `Addon`, `Petscii`, `Incl` and `Plumb` as the earlier changes wrote them), each sentence checked against its run (core/builtins.zig; core/Output.zig `openThemes`, `fontsListed`; core/locations.zig `Config.parse`; core/mini.zig `open`; core/edit.zig `clipYank`; core/sam_edit.zig's list of what is left out of sam): Themes and Fonts (each a `Theme `, `Font ` line to run), ThemeFile and DumpThemes (each names the other), TreeContext, Palette and Ascii (`on`/`off`, `commodore`/`terminal`, bare flips; was lower-case fragments, "the C64 palette or the terminal's own 16"), ClipYank (every cursor's selection, joined; an image's or a PDF's selection), DumpConfig, LocationsConfig (its four fields as typed; bare, +LocationsConfig), Mini (`Mini notes.txt`; drawn once, again at the next Mini), Back (a closed file's place opens it again), Last (with none, the pane beside), Jumplist (+Jumps), Edit (`Edit ,s/old/new/g`; what of sam's is left out), Undo and Redo; docs/typ/builtins-tui.json regenerated Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/builtins.zig | 81 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 22 deletions(-) (limited to 'core/builtins.zig') diff --git a/core/builtins.zig b/core/builtins.zig index 626e8ec3..dfa0b534 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -792,7 +792,7 @@ pub const NextColor = struct { } }; -/// List the themes in a pane, each a word to click. +/// List the bundled themes in a +Themes, each a `Theme ` line to run. pub const Themes = struct { pub const scope: Scope = .session; pub const output: OutputTraits = .{ .name = config.themes_buffer, .steps = true, .commands = true }; @@ -801,7 +801,9 @@ pub const Themes = struct { } }; -/// Load a theme from a file. +/// Load a theme from a .zon file: `ThemeFile ~/themes/mine.zon`. +/// +/// DumpThemes writes the bundled ones out to start from. pub const ThemeFile = struct { pub const scope: Scope = .session; pub const takes_arg = true; @@ -818,7 +820,10 @@ pub const ThemeFile = struct { } }; -/// Write the bundled themes into the config directory's themes, to edit. +/// Write the bundled themes into the configuration directory's themes, to +/// edit. +/// +/// ThemeFile loads one back. pub const DumpThemes = struct { pub const scope: Scope = .session; pub fn run(c: Ctx) void { @@ -830,7 +835,7 @@ pub const DumpThemes = struct { } }; -/// List the fonts in a pane, each a word to click. +/// List this machine's fonts in a +Fonts, each a `Font ` line to run. pub const Fonts = struct { pub const scope: Scope = .session; pub const output: OutputTraits = .{ .name = config.fonts_buffer, .steps = true, .commands = true }; @@ -842,7 +847,10 @@ pub const Fonts = struct { } }; -/// Show the declarations enclosing the top row at the pane's head, on or off. +/// Show, at the pane's head, the declarations its top row is in. +/// +/// `TreeContext on` or `off` sets it; bare, it flips. Only a source file the +/// parser knows has them. pub const TreeContext = struct { pub const takes_arg = true; @@ -906,7 +914,10 @@ pub const Petscii = struct { } }; -/// the C64 palette or the terminal's own 16 +/// Draw an image pane's glyph art in the C64 palette, or in the terminal's +/// own 16 colours. +/// +/// `Palette commodore` or `Palette terminal` sets it; bare, it flips. pub const Palette = struct { pub const needs: PaneKind = .image; pub const takes_arg = true; @@ -920,7 +931,10 @@ pub const Palette = struct { } }; -/// add the printable ASCII bitmaps to the matcher's glyph set +/// Add the printable ASCII glyphs to those an image pane's glyph art is made +/// of, or take them out. +/// +/// `Ascii on` or `off` sets it; bare, it flips. pub const Ascii = struct { pub const needs: PaneKind = .image; pub const takes_arg = true; @@ -937,14 +951,19 @@ pub const Ascii = struct { // ---- the system clipboard ---- /// Copy the selection to the system clipboard. +/// +/// Every cursor's selection, joined; in an image or a PDF's pane, what it has +/// selected. pub const ClipYank = struct { pub fn run(c: Ctx) void { edit.clipYank(c.p, c.pane, false); } }; -/// helix `Y`: the PRIMARY selection alone, where `SPC y` joins every -/// cursor's. One cursor makes them the same word. +/// Copy the primary selection alone to the system clipboard. +/// +/// ClipYank (`SPC y`) copies every cursor's selection, joined; with one +/// cursor the two are the same. pub const ClipYankMain = struct { pub fn run(c: Ctx) void { edit.clipYank(c.p, c.pane, true); @@ -1359,8 +1378,10 @@ pub const Togglettymode = struct { /// Run a command of sam's language over the open text panes, starting in this /// pane's body. /// -/// As acme's Edit: from a tag, a pane's ctl or an exec. One undo step in each -/// file it changes; a failure changes nothing and says why. +/// `Edit ,s/old/new/g` changes every old to new in this pane's text. As +/// acme's Edit: from a tag, a pane's ctl or an exec; one undo step in each +/// file it changes; a failure changes nothing and says why. Left out of +/// sam's: the `'` address, `B ` around each, `tscontext:on|off`, +/// `tslocations:on|off`, `layout:inline|stacked`; those not given stay. Bare, +/// it shows them in a +LocationsConfig. pub const LocationsConfig = struct { pub const scope: Scope = .session; pub const takes_arg = true; @@ -1675,7 +1705,7 @@ pub const LocationsConfig = struct { } }; -/// Open the messages shown so far. +/// Show the messages said so far in a +Messages. pub const Messages = struct { pub const scope: Scope = .session; pub const output: OutputTraits = .{ .name = config.messages_buffer }; @@ -1707,7 +1737,10 @@ pub const Changelog = struct { } }; -/// Open a minimap of the file in braille dots. +/// Map a file of this pane's directory in braille dots: `Mini notes.txt`. +/// +/// A pane of its own, drawn once: a Mini of the same file again draws it +/// anew. pub const Mini = struct { pub const takes_arg = true; pub const requires_arg = true; // a file to map: bare, wrong #args (EINVAL) @@ -1943,7 +1976,9 @@ pub const Window = struct { // ---- the jump group ---- -/// Ctrl-o: one step back into the history. +/// Go one step back in the jump history. +/// +/// A place in a file closed since opens the file again. pub const Back = struct { pub const scope: Scope = .session; pub fn run(c: Ctx) void { @@ -1951,7 +1986,7 @@ pub const Back = struct { } }; -/// Ctrl-i: one step forward again, up to wherever Back started. +/// Go one step forward again in the jump history, up to where Back started. pub const Forward = struct { pub const scope: Scope = .session; pub fn run(c: Ctx) void { @@ -1982,6 +2017,8 @@ pub const LookPrev = struct { }; /// Go back to the last place jumped from in another pane. +/// +/// With none, to the pane beside this one. pub const Last = struct { pub fn run(c: Ctx) void { var i = c.p.view().jumps.n; @@ -2034,7 +2071,7 @@ pub const History = struct { } }; -/// List the places jumped from, each a place to go. +/// List the places jumped from in a +Jumps, each a place to go. pub const Jumplist = struct { pub const scope: Scope = .session; pub const output: OutputTraits = .{ .name = config.jumps_buffer, .steps = true, .locations = true }; -- cgit v1.3