A small, fast, keyboard-driven text editor. Vim-style modal editing is on by
default. The core is C; everything else is Lua you can read and change.
cdin started as a fork of lite. The fork kept what made lite interesting — a tiny C runtime, a Lua editor on top, and a clean boundary between the two — and built from there.
The C layer handles the window, the renderer, and the SDL bindings. It doesn't
know anything about documents, keybindings, or plugins. The Lua layer, loaded
at startup from data/, is the actual editor. This means you can change how
almost anything works — commands, keybindings, UI behavior, syntax highlighting
— without recompiling. The binary is just a host.
Vim-style modal editing is built in and on by default. Every buffer opens in
Normal mode. The status bar always shows [NORMAL], [INSERT], or [VISUAL]
so you always know where you are. If you've used vim the basics transfer
directly. If you haven't, Vim Keybindings
has everything you need.
The codebase is meant to be readable. You should be able to find the edit loop, understand what it does, and change it. Functions are short. Modules are small. There are no clever abstractions that require you to know the whole project before touching any of it.
Features belong in plugins. The core does the minimum that every editor needs.
Anything optional is in data/plugins/ where it can be read, copied, modified,
or replaced without touching the core. This is how lite-xl approaches things
too, and it works.
Startup time and memory use matter. The renderer only redraws what actually changed. Background tasks are coroutines, not threads. An idle cdin draws almost nothing and uses almost no CPU.
- Modal editing (Normal / Insert / Visual) built on the vim model
- Ex command line (
:w,:q,:e,:!cmd, and more) - Project tree with optional git status markers (A / M / D / ?)
- Multi-tab management and split panes
- Project-wide search
- Fuzzy file finder (
Ctrl+P) - Session restore
- Syntax highlighting for C, Lua, Markdown, Python, JavaScript, TypeScript
- Trailing whitespace trimmed on save
- Relative or absolute line numbers
- Three bundled themes; write your own in a single Lua file
- Configurable through
data/user/init.lua— plain Lua, no DSL
git clone https://github.com/m-mdy-m/cdin.git
cd cdin
# build (requires gcc, make, SDL3, Lua 5.4)
make
# run in the current directory
./build/linux-release/cdin .
# or open a file
./build/linux-release/cdin path/to/file.cSee Building from Source for dependencies and platform-specific notes. There's also a Python script if you prefer not to use make directly:
python3 scripts/cdin.py build-install- Getting Started — the screen, modal editing, essential keys, where things live
- Building from Source — dependencies, make targets, install, Windows
- Configuration — every config option, keybindings, themes, project-local config
- Vim Keybindings — modes, motions,
operators, ex commands, the
maction menu - Themes — bundled themes, writing your own, the full style table
- Plugins — bundled plugins, writing your own, the plugin API
- Command Reference — every command and its default binding
- Troubleshooting — common problems and how to fix them
- Architecture Overview — the C/Lua split, the frame loop, how commands and plugins work
- Contributing
All build, install, and asset tasks go through one entry point:
python3 scripts/cdin.py [command]| Command | Does |
|---|---|
build |
Compile from source |
install |
Install binary + data + desktop integration |
build-install |
Build then install in one step |
update |
Download the latest release from GitHub |
uninstall |
Remove an installation |
gen-icon |
Regenerate icons from scripts/icon.svg |
gen-logo |
Regenerate data/core/rootview/logo.lua |
Run with no arguments for an interactive wizard. Full documentation is in
scripts/README.md.
MIT — see LICENSE.
- Based on lite by rxi
- Inspired by Vim and lite-xl
- Font rendering via stb_truetype