Buffee, the text slayer — embeddable terminal-like text editor for netizens — lean, hackable, unbounded

"If Neovim is the modern Vim, and Helix is the post-modern Vim, then Buffee is the post-post-modern Vim."

0.001MB

distributable (min+brotli)

0

Dependencies

0ms

Build time

0ms

VDOM overhead

~70m

LOC capacity

1B+

in pro max mode

Ln , Col |

Blazing fast, inspired by the minimalist focus of Vim and the terminal

The core is rendering engine optimized for monospace plaintext in grid-layout.

const textBuffer = Buffe($DOM);

Buff(e) is a text buffer. It manages text lines (the model) and a viewport (the view) into these lines onto the grid. Crucially, retaining a small DOM footprint, independent of text length. Fun fact: this project descended from an effort to view large distributed server logs in browser.

const textEditor = Buffee(Buffe($DOM));

Buff(ee) is the complementary text editor. Buffe is Model-View, Buffee is Model-View-Controller. Buffe is ~1.6KB, Buffee adds ~500 bytes for fair keyboard controls. They were <2KB bundled but the decoupling overhead is worth the flexibility. i.e. Clients can opt for Vim controls.

buffe
  .Model             Text Buffer
  .View              Viewport
  .Span              Cursor/Selection
  .Mode              Editor State
  .plug(ctrl)        Register controller
  .unplug()          Remove current controller

Hackability is virtue with an API surface curated to be minimal but powerful. Primitive, CRDT friendly, editing operations are tightly coupled with rendering and buffer management as to maximize performance. Buffe also owns cursor/selection (multi-cursor coming soon).

The V8 team played big role in keeping the code compact -- they made Arrays (not actually arrays) viable as a text buffer. Compare with complex structures, plural, needed by native editors, e.g. piecetable. Content/syntax aware features aside, Buffee rival performance of native editors.

Maximalist combinator-oriented extension system // Inspired by Neovim

The extension system is with combinators - functions that take as input a buffee instance and return a buffee instance with more functionality. This is novel because, unlike other text editors, Buffee is just a callable function that you can readily access and reprogram.

In fact, Buffee self-hosts by being implemented as a combinator extension of Buffe.

const editor = BuffeeVimMotion(
                 BuffeeSyntax(
                   BuffeeHistory(
                     BuffeeStatusLine(
                       Buffee(
                         Buffe($DOM))))));

Buffe follow's Neovim philosophy of "hyper-extensibility" and discrete single-purpose extensions. These extensions can be chained and combined, hence combinator. Bring your own status line, controllers, everything. Build your own editor.

Explore: combinators

TUI

TUI mode ship as a combinator. As notcurses brings browser bling to the terminal, Buffee completes the circle by ushering in 20th century paradigms to the modern web. Terminal-based agentic coding tools have re-ignited interest in TUIs. Personally, I'm keen on liberating OrgMode from the text-based-UI, err operating system, that is Emacs.

Tab to next element. Enter to activate.

Ln , Col |

Live HackerNews Front Page