Sign inSign up

bitsgenix/cdin

By bitsgenix

•Updated 7 days ago

small, fast, keyboard-driven text editor

Image
Developer tools
0

1.2K

bitsgenix/cdin repository overview

⁠cdin

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

License Version


⁠What it is

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.

cdin editor screenshot

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.

⁠Philosophy

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.

⁠Features

  • 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

⁠Quick start

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.c

See 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

⁠Documentation

⁠Scripts

All build, install, and asset tasks go through one entry point:

python3 scripts/cdin.py [command]
CommandDoes
buildCompile from source
installInstall binary + data + desktop integration
build-installBuild then install in one step
updateDownload the latest release from GitHub
uninstallRemove an installation
gen-iconRegenerate icons from scripts/icon.svg
gen-logoRegenerate data/core/rootview/logo.lua

Run with no arguments for an interactive wizard. Full documentation is in scripts/README.md⁠.

⁠License

MIT — see LICENSE⁠.

⁠Credits

Tag summary

Content type

Image

Digest

sha256:759986f7e…

Size

93.8 MB

Last updated

7 days ago

docker pull bitsgenix/cdin