hjkl-ex
Ex-command registry and dispatch layer for the hjkl editor stack.
Provides a typed Registry for ex commands, range parsing, Tab-completion, and
the full :set option table. Host applications register commands and call
try_dispatch to let hjkl-ex handle them; unrecognised commands fall back to
the host's own handling.
What lives here
Registry<H>/HostRegistry<Ctx>— extensible command registries with canonical names, aliases, andArgKindmetadata used by the completer.try_dispatch— resolves a command string against the editor registry and returns anExEffect(save, quit, info, error, …), orNonewhen no match.complete/complete_arg— Phase 6 Tab-completion engine. Resolves the command token, then dispatches to path, setting, buffer, register, or mark completion based on the command's declaredArgKind.all_setting_names— flat list of all:setoption names and aliases, consumed by the host's completionArgSources.parse_range— Vim-compatible line-range parser (%,.,$,'a, …).
Usage
= "0.1"
use ;
// Register commands (or use the built-in default_registry).
let reg = ;
let host_reg = new;
// Dispatch a command string (without the leading ':').
if let Some = try_dispatch
// Tab-completion for the prompt.
let settings: = all_setting_names;
let sources = ArgSources ;
let completions = complete;
// completions.candidates == ["nu", "number", "numberwidth", …]
Umbrella repo
This crate is developed inside kryptic-sh/hjkl.
License
MIT. See LICENSE.