I started Fluke because I wanted an editor I could read in an afternoon. No plugins, no async job system, no configuration language. Just a terminal, a buffer, and modal editing. It ended up teaching me more about program design than most larger projects I’ve worked on.
State has to be explicit
In a modal editor there is no such thing as “what the user meant.” Every keypress is interpreted against exactly one current mode, and the mode is a single enum, not a pile of booleans. The moment I tried tracking isSelecting && !isSearching style flags, bugs multiplied. One enum, one dispatch switch, transitions in one place. Boring, and it works.
Terminal input is a protocol, not a keyboard
Arrow keys, function keys, and paste events all arrive as escape sequences over stdin, sometimes split across reads. You can’t treat stdin like getchar() in a textbook. The editor needs a small parser with a timeout: ESC alone means escape, ESC [ followed by more bytes means something else. Getting this wrong produces the classic terminal bug where pressing Escape inserts ^[ garbage. Worse, a fast paste gets interpreted as fifty separate commands.
Crash recovery beats features
An editor that loses your work on a segfault is a toy. The most valuable code in Fluke isn’t syntax highlighting or the fuzzy palette. It’s the discipline of keeping the buffer always in a writable state and writing it out on signals. SIGSEGV handling is best-effort fiction, but handling SIGHUP, SIGTERM, and cleaning up raw mode on every exit path is very real. Users forgive missing features. They don’t forgive losing a file.
Small is a feature
The whole codebase fits in your head, which means every bug is findable with printf and patience. No build system beyond cc *.c. No dependencies. When something breaks, the distance between symptom and cause is short. I’ve started applying that test to everything I build now: if I can’t explain the whole system in one sitting, it’s carrying something it doesn’t need.
Fluke is on GitHub at shx-dow/fluke. It’s not trying to replace your editor. It’s trying to be fully understood. That’s a rarer thing.