kilo
A text editor in less than 1000 LOC with syntax highlight and search.
A minimal terminal text editor written in fewer than 1,000 lines of C with no external library dependencies, designed as a readable starting point for building your own command-line editor.
Kilo is a minimal text editor written in the C programming language, fitting entirely within fewer than 1,000 lines of code. It runs in a terminal window and supports basic editing operations, syntax highlighting, and text search. The keyboard shortcuts are simple: Ctrl-S to save, Ctrl-Q to quit, and Ctrl-F to search for a string within the file.
One notable aspect of Kilo is that it does not rely on any external libraries, including common terminal libraries that most similar tools use. Instead it works by sending low-level terminal control sequences directly, which keeps the code small and portable.
The author describes the project as being in an alpha (early, unfinished) state and notes it was written in just a few hours, drawing from two of his earlier projects. The primary audience is developers who want a readable starting point for building their own terminal text editor or a similar command-line interface. The codebase is intentionally minimal so it is easy to read, understand, and modify.
The project was created by Salvatore Sanfilippo, known online as antirez, who is also the creator of Redis. It is released under the BSD 2-Clause license, which permits free use and modification. The README is brief and the project scope is narrow by design.
Where it fits
- Use Kilo as a starting point to build your own terminal text editor by reading and modifying its short, well-structured C source code.
- Learn how terminal control sequences work and how editors handle raw input without relying on any external libraries.