explaingit

antirez/kilo

8,902CAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((Kilo))
    What it does
      Terminal text editor
      Under 1000 lines
      No dependencies
    Features
      Syntax highlighting
      Text search
      Basic editing
    For learning
      Read and modify
      Terminal sequences
      C programming
    License
      BSD 2 Clause
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Use Kilo as a starting point to build your own terminal text editor by reading and modifying its short, well-structured C source code.

USE CASE 2

Learn how terminal control sequences work and how editors handle raw input without relying on any external libraries.

Tech stack

C

Getting it running

Difficulty · easy Time to first run · 5min
Free to use and modify under the BSD 2-Clause license, including in commercial projects.

In plain English

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.

Copy-paste prompts

Prompt 1
Walk me through how Kilo switches the terminal into raw mode in C, which part of the kilo.c source handles that and why is it necessary?
Prompt 2
I want to add line number display to the Kilo editor, help me modify the rendering code to show them on the left side.
Prompt 3
Explain how Kilo implements syntax highlighting using its own source as the example, step by step.
Open on GitHub → Explain another repo

← antirez on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.