MMotor OS
Userspace

Editors

Two editors ship in /user/bin: red, which behaves like vi and is on every image, and kibim, a small kilo-style editor on the standard and developer images. The developer image also includes Helix with native rust-analyzer integration.

Helix and Rust on the developer image

Run hx from a Rust package directory. Helix starts the native rust-analyzer automatically and uses Lorry for project metadata, build scripts, and checks on save. Native rustfmt formats Rust buffers. All three programs run inside Motor OS.

The image includes an example that needs no downloads:

cd /devtools/src/helix-rust-demo
hx src/main.rs

Wait for initial source loading and indexing to finish (the LSP spinner stops). Put the cursor on ANSWER to explore the local module, or on rt_version to navigate into Motor's installed standard-library sources.

Helix keysAction
Space, kshow type and documentation
g, dgo to definition
Ctrl-oreturn to the previous location
Ctrl-x in insert moderequest completion
:formatformat the buffer without saving
:wformat, save, and run the project check
Space, dopen the document diagnostics
:qquit

For a quick diagnostic, change u32 to bool in the example's let answer line and save. Restore u32 and save again to clear the error.

Rust buffers format automatically when saved. A project rustfmt.toml controls formatting in the usual way; without one, rustfmt reads /user/rustfmt.toml and then /user/cfg/rustfmt/rustfmt.toml. If the source has a parser error, rustfmt leaves the buffer unchanged; repair the source and use :format or save again.

Existing projects must be admitted and prepared for Lorry; run lorry vendor explicitly when their dependencies need acquiring. Select a package containing Cargo.toml, rather than a virtual workspace root. Native analyzer procedural-macro expansion is disabled; compiler checks still use Lorry's supported build-script and procedural-macro policies.

The default server settings are in /user/cfg/helix/languages.toml; the editor log is /user/tmp/.cache/helix/helix.log. Project settings in .helix/languages.toml can override them. If you choose another XDG_CONFIG_HOME, copy the native settings to its helix/languages.toml. Use hx --health rust to check server and parser discovery, :log-open for editor logs, and :lsp-restart after changing server settings or project metadata.

red

red is a terminal editor written from scratch with only the Rust standard library: no crossterm, no libc. It renders each frame into an in-memory grid of cells and diffs it against the previous frame, so typing rewrites only the edited line from the first changed column and a cursor move rewrites only the digits in the status bar. It runs in the alternate screen, restores the terminal on exit and on panic, decodes UTF-8, renders tabs at configurable stops, and writes files with POSIX line termination (a file that had no final newline gains one; an untouched file saves byte-for-byte identical).

Modes and keys

Five modes, as in vim: NORMAL, INSERT, VISUAL (v), VISUAL LINE (V), and COMMAND (:).

Normal modeAction
i a o Oinsert at or after the cursor; open a line below or above
h j k l, arrows, 0 $ g Gmove; start and end of line; first and last line
Ctrl-F Ctrl-B, PageDown, PageUppage down and up
/ ? n Nsearch forward and backward, next and previous match
x p Jdelete a character, paste, join lines
← →previous and next buffer (in normal mode)
CommandAction
:w, :w name, :q, :q!, :wq, :xsave, save as, quit, force quit, save and quit
:Ngo to line N
:set nu / nonu, :set wrap / nowrapline numbers and soft wrapping (both on by default)
:e file, :ls, :bn, :bp, :b N, :b name, :bdopen a file in a new buffer, list buffers, switch, close (add ! to discard changes)

In visual modes, y yanks and d, x, or Delete cuts the selection; the normal-mode motions extend it. Insert mode has Backspace, Delete, Enter, Tab (spaces to the next tab stop unless expandtab is off), and arrows.

Configuration and highlighting

red reads an optional /user/cfg/red.toml ($HOME/.config/red.toml on Linux) with two options named after their vim equivalents: tabstop (default 4) and expandtab (default true). Syntax highlighting is incremental and cascades block state (a multi-line comment) down only as far as it changes, for Rust, Bash, C and C++, and TOML.

On Motor OS red gets its size from the terminal-size protocol described under Terminals, so it lays itself out correctly on the console, in an SSH session, and in an rmux pane, and repaints when the size changes.

kibim

kibim is Motor OS's build of kibi, a small editor in the tradition of kilo: modeless editing with a status bar, incremental search, and syntax highlighting defined by INI files. The highlighting definitions for about thirty languages live under /user/cfg/kibim/syntax.d/, and the editor's own settings in /user/cfg/kibim/.