No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-14 22:45:18 +02:00
docs _ 2026-07-14 22:22:34 +02:00
src _ 2026-07-14 22:45:18 +02:00
.gitignore _ 2026-07-09 16:54:50 +02:00
build.zig _ 2026-07-14 22:45:18 +02:00
build.zig.zon update 2026-06-14 20:27:39 +02:00
LICENSE . 2026-06-27 15:38:54 +02:00
README.md . 2026-06-28 16:54:32 +02:00
TODO.md _ 2026-07-14 22:22:34 +02:00

█▀▀▄ █▀▀▄ █▀▀▀ █▀▀▄ █ ▀▀█▀▀ ▄▀▀▀▄ █▀▀▄
█▀▀▄ █▀▀▄ █▀▀  █  █ █   █   █   █ █▀▀▄
▀▀▀  ▀  ▀ ▀▀▀▀ ▀▀▀  ▀   ▀    ▀▀▀  ▀  ▀

Terminal text editor + file manager

A modal text editor (inspired by helix) and file browser (inspired by yazi) in one binary. Written in Zig 0.16.0 using libvaxis.

Features

  • Modal editing — normal, insert, select, replace modes with vim-like bindings
  • File browser — 3-panel layout (parent / cwd / preview), open files into the editor
  • Rope-based text storage — binary-tree rope with insert/delete mutation
  • Unicode-correct rendering — grapheme clusters via vaxis.unicode.graphemeIterator, terminal-column tracking via vaxis.gwidth.gwidth (CJK, emoji ZWJ, combining marks)
  • Column-aware cursor — cursor position tracks display columns, not codepoints
  • File I/O — owns an Io.File handle per buffer, :w / :w <path> write via writeStreamingAll (no re-open on save)
  • Command mode — :q (quit), :w (write), :w <path> (save-as)
  • Status bar — mode label, filename, cursor row:col

Quick start

zig build
./zig-out/bin/breditor              # start in file browser
./zig-out/bin/breditor src/main.zig  # open file directly

Default keybindings

see breditor -h

Overview

File Responsibility
main.zig Entry point, event loop; re-exports for zigdoc
types.zig Shared types (Event, AppMode, EditorMode, FileEntry)
RopeNode.zig Binary-tree rope with mutation (insertAt, deleteAt)
EditorState.zig Cursor, scroll, grapheme-based render, position helpers
BrowserState.zig File-browser listing, preview helpers
App.zig App state, key routing, mode dispatch, rendering, file I/O

Documentation

Document Covers
docs/DESIGN.md Overview, module table, key decisions
docs/ARCHITECTURE.md Event loop, mode dispatch, keybindings
docs/ROPE.md RopeNode, Unicode handling, cursor
docs/IO.md File ownership, reading/writing, browser, command mode
docs/FUTURE.md Planned features, polish items