Skip to content

wilson/vv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

vv

First-principles modern vi.

Adoption is not sought, though please feel free.

There is no plugin API, just ground-up extensibility.

Thesis

The gap between "bringing up a new OS/hardware platform" and "having a usable editor" is too wide.

vv bridges this gap.

It uses Zig's comptime to compile into three distinct "Planes of Abstraction," allowing the same core text logic to run on an EFI shell, a QNX rescue terminal, or a macOS desktop.

Architecture

Plane 0: vv-static (Hardware Tier)

  • Target: freestanding (UEFI Shell, Kernel Mode, Bare Metal).
  • Constraints: No libc. No heap allocator. No syscalls.
  • Memory Model: Fixed-size static arena (Slab) in .bss.
  • Topology: Nodes are linked via u32 array indices, not pointers. The state is relocatable and trivially serializable (mem-dumpable).
  • Use Case: Hex-editing RAM, patching bootloaders, emergency driver debugging.

Plane 1: vv-core (Console Tier)

  • Target: QNX, Minix, Linux initramfs.
  • Constraints: libc available. No external dependencies, even ncurses.
  • I/O: Raw VT100/ANSI output.
  • Use Case: System configuration on in-development operating systems.

Plane 2: vv-lux (Desktop Tier)

  • Target: Linux, macOS, *BSD.
  • Features: (WIP)
    • Tree-sitter: Statically linked for AST-based structural movement (e.g. vi[ works on the AST).
    • Input: Async I/O, USB HID support (Pedal/Clutch integration).
    • Memory: Dynamic heap.

Data Structure

vv evaluated the Gap Buffer and Piece Table approaches, and while viable, has chosen something else.

The text buffer is represented by a Sequence CRDT (DAG) derived from the Eg-walker/Fugue papers:

  • The Graph: Text is a Directed Acyclic Graph of immutable nodes.
  • The Z-Axis: There are no "tombstones" or delete flags.
    • Deletion is modeled as the insertion of a Mask Node (Occluder) that targets the original content.
    • The renderer projects the graph; occluded nodes (Depth > 0) are skipped or rendered as "history" depending on the mode.
  • Client IDs: In Plane 0, Client ID is hardcoded to 0 (single-user).

Configuration

There is no runtime configuration parsing.

  • Config is defined in src/config.zig.
  • Changes require zig build -Doptimize=ReleaseFast.

Building

# Desktop (Plane 2)
zig build -Dplane=lux

# QNX / POSIX (Plane 1)
zig build -Dplane=core -Dtarget=x86_64-unknown-linux-musl

# UEFI / Bare Metal (Plane 0)
zig build -Dplane=static -Dtarget=x86_64-uefi

© 02026 Wilson Bilkovich

About

First-principles vi-inspired editor in Zig.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published