A modeless, dependency-free text editor for the terminal, written in C11.
Menus, mouse, splits, multiple cursors, an integrated terminal, git and
language servers, with nothing to install but Molly itself.
Quick start · Features · Keys · Manual · Design
Molly is the big sister to olly. It keeps olly's modeless editing (start typing and you are editing) and its zero external dependencies, but not olly's self-imposed limits of one file, one cursor, no regex and no config. It is modeled on Fresh, a terminal editor that behaves like a GUI one: a menu bar, the mouse, dialogs, splits, and everything discoverable from inside the editor.
make # build
make install # install to /usr/local/bin, or ~/.local/bin without sudo
molly file.c # open a fileStart typing; every key goes in at the cursor. Save with Ctrl-S, search with
Ctrl-F, and select with Shift and the arrows. F10 or a click opens the
menu bar, Ctrl-Space lists every command, and F1 shows the keys.
molly # an unnamed buffer
molly new.txt # a file that doesn't exist yet opens empty
molly one.c two.c # several files, one tab each
molly file.txt +42 # cursor on line 42 (+42 file.txt works too)
molly --version # print the version and exit- Modeless: type to insert, arrows to move,
CtrlandAltkeys act. - Grouped undo and redo: a run of typing, a paste or a whole replace-all undoes as one step.
- Multiple cursors:
Ctrl-Dadds the next occurrence of the word,Ctrl-Up/Ctrl-Downbuild a column,Alt-click puts one anywhere. Typing, deleting,Enter,Taband paste reach every cursor as a single undo step. - Block selection:
Alt-Shiftand the arrows, orAlt-drag, select a rectangle; a copied block pastes back as a block. - Words and lines: move and delete by words; duplicate, move, join, comment,
sort, trim and change the case of lines. Smart
Homeand auto-closing brackets and quotes are settings. - Indentation that follows the filetype: tab width, tabs or spaces and auto-indent are set for everything or per language, and existing files convert either way from the Edit menu.
- Keyboard macros:
Alt-(records andAlt-)plays back typing, commands, prompts and dialogs. - UTF-8 throughout: the cursor moves over whole characters, wide (CJK) and combining characters stay aligned, and text round-trips as raw bytes.
- System clipboard: copy and cut also reach the terminal's clipboard through OSC 52, where the terminal supports it.
- Find, with match-case and regular-expression toggles, wrapping around the file. Replace the next match or all of them.
- Find in files with
git grep(orgrep -routside a repository), withF4stepping through the results from anywhere. - Back and forward through every jump, across files; go to a line, the matching bracket, or one of ten bookmarks.
- Folding by indentation, soft wrap per window, and from the View menu whitespace, indent guides, the current line, the word under the cursor and a ruler.
- Any number of files in a tab bar, each with its own cursor and undo history. Window splits side by side or stacked, resized with the keyboard or by dragging; two windows on one file are two views of the same text.
- Open dialog (
Ctrl-O) to browse to a file, and recent files (Alt-O) for the last twenty. - Big files: a 743 MB, ten-million-line log opens in under half a second, in about 1.5 times its size in memory. A file bigger than half of the memory there is opens read-only, read from the disk as it is shown: an 8 GB log opens and is searched in 512 MB.
- Syntax highlighting for Rust, C, C++, C#, Python, AutoIt and Markdown.
It is table-driven, so a
[syntax <name>]block in the config teaches it another language. - Language servers: with clangd, rust-analyzer or pylsp installed, Molly gives you diagnostics, go to definition, hover, completion with snippets, signature help, find references, rename, formatting and code actions. It asks once per project before starting a server, since a server may run the project's code. Any other server is one line in the config.
- Git: a sign column marks lines added, changed or deleted as you type; blame and file history are in the palette. Molly runs git with the repository's own programs (filters, fsmonitor, external diff) turned off.
- Integrated terminal:
Alt-Topens your shell below the file. Colors,less,vimandhtopdraw as they would in xterm, with 5,000 lines of scrollback, the mouse, 24-bit color and bracketed paste. - Shell filters:
Alt-|pipes the selection or file throughsort,jq,fmtor any pipeline;Alt-!inserts a command's output at the cursor. A failed command leaves the text unchanged.
- Atomic saves through a private temporary file. Where a rename would lose something (another user's ownership, a hard link, an ACL), Molly rewrites in place and says so.
- Nothing lost in translation: each line's ending (
LForCRLF), a missing final newline, and the file's mode and owner are preserved. A file changed on disk since it was opened is not overwritten without asking. - Crash recovery: a signal or out-of-memory condition writes unsaved changes
to a
.molly-recoverfile, offered back the next time you open the file. - Safe with untrusted files: control characters, malformed UTF-8 and the
invisible characters that reorder right-to-left text show as a reversed
?and never reach your terminal, a paste is only ever text, and the binary is built with the usual exploit mitigations. - Dirty-quit protection: with unsaved changes,
Ctrl-Qasks before it exits.
~/.config/molly/mollyrc holds the settings and the keymap. View ▸ Options…
changes any setting in place and View ▸ Save Settings writes the file. Every
action is a named command, so any key can be rebound, and the command palette
(Ctrl-Space) lists them all.
The essentials are below; F1 inside Molly shows them all, and
MANUAL.md explains each one.
|
Files and buffers
Windows
Search and jump
|
Editing
Code
View
|
Molly runs on Linux. macOS is not supported, and Windows may come later.
make builds Molly with any C11 compiler; there is nothing else to install.
make install copies it to /usr/local/bin, or to ~/.local/bin when that
isn't writable, so no sudo is needed.
| Command | Does |
|---|---|
make install PREFIX=/some/dir |
Install somewhere else |
make install DESTDIR=/wherever |
Stage a package |
make uninstall |
Remove it |
make HARDEN= |
Build without exploit mitigations, for a compiler that lacks them |
make test |
Run the test suite |
Molly keeps the parts of olly's design that cost nothing and drops the ones that limited it.
| Kept | Dropped |
|---|---|
| No runtime dependencies: a C11 compiler and a terminal are all it needs | The single-source-file rule: Molly is several files and a real build |
| Modeless by default: no modes to learn, none to forget you are in | One file, one cursor, one window |
| Instant start and careful saves | No regex, no configuration, no syntax awareness |
| Discoverable: anything Molly can do can be found from inside Molly | Ctrl keys only: Molly uses Alt too, and puts a menu bar on it |
Molly should never become slow to start, dependent on a runtime, or impossible
to use without reading the manual first. Features will be added; the feel
should stay the same. The decisions behind it, and what has been ruled out, are
in DESIGN.md.
Molly is a fork of olly, which builds on the architecture of antirez's
classic kilo editor. Both are credited in NOTICE.
MIT. See LICENSE.