kg is a small, fast terminal text editor with pure Emacs keybindings. Suitable for editing system files or quick fixes on remote systems where a full GUI editor is not available.
With syntax highlighting for many languages, multiple buffers, split windows, incremental search, and multi-level undo, kg punches above its weight while staying dependency-free — no curses, just standard VT100 escape sequences.
- Pure Emacs-style keybindings
- Syntax highlighting for many programming languages
- Multiple buffers with shared kill ring
- Split-window support
- Incremental search
- Auto-indent and bracket autocomplete
- Built-in help screen (C-h)
- No dependencies (not even curses)
- Uses standard VT100 escape sequences
- Graceful terminal resize handling
kg [-RVh] [file ...]
| Option | Description |
|---|---|
-R |
Open file(s) read-only |
-V |
Print version and exit |
-h |
Print this help and exit |
Multiple files can be opened at once, each in its own buffer. See the man page for more in-depth information as well as the full key binding reference.
make
sudo make install # installs to /usr/local/bin and /usr/local/share/man/man1Override the prefix or use DESTDIR for staged installs:
make install prefix=/usr
make install DESTDIR=/tmp/pkgTo uninstall:
sudo make uninstallkg is based on kilo by Salvatore Sanfilippo (antirez), the original minimal text editor that demonstrates how to build a functional editor without dependencies in about 1000 lines of C code.
The name "kg" is a nod to "mg" (Micro Emacs), suggesting "kilo-gram" - a minimal implementation with Emacs keybindings.