mirror of
https://codeberg.org/nammenam/breditor.git
synced 2026-08-21 07:45:47 +00:00
No description
- Zig 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| docs | ||
| src | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| LICENSE | ||
| README.md | ||
| TODO.md | ||
█▀▀▄ █▀▀▄ █▀▀▀ █▀▀▄ █ ▀▀█▀▀ ▄▀▀▀▄ █▀▀▄
█▀▀▄ █▀▀▄ █▀▀ █ █ █ █ █ █ █▀▀▄
▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀ ▀
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 viavaxis.gwidth.gwidth(CJK, emoji ZWJ, combining marks) - Column-aware cursor — cursor position tracks display columns, not codepoints
- File I/O — owns an
Io.Filehandle per buffer,:w/:w <path>write viawriteStreamingAll(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 |