martha

A terminal editor you can change while it's running.

Martha runs in your terminal: a small Rust core with Lua inside it. Every command, key, window and mode is Lua, including the defaults. Edit your config, save, and the editor is already different.

martha --session work
init.lua — martha [work]
  1 local m = require("martha")
  2 
  3 -- asked: "fuzzy buffer switcher on C-x b"
  4 m.keymap.set("C-x b", m.cmd.switch_buffer)
  5 
  6 m.hook("before-save", function()
  7   m.cmd.trim_trailing_whitespace()
  8 end)
  9  
-- init.lua (lua) L9 C1 undo 212
~/code/app % cargo test
   Compiling app v0.4.0
    Finished `test` profile
     Running unittests
test result: ok. 41 passed
~/code/app % 
-- *terminal* (term 48x9)
why C-x b → switch_buffer, bound at ~/.martha/init.lua:4 [e]dit [d]isable [u]ndo
A session called work: a Lua buffer and a shell, side by side. Quit, run martha --session work tomorrow, and both come back.

What it does

Reloads itself.
init.lua reloads on save. Evaluate any region, or open a REPL into the running editor. Nothing restarts.
Answers "why".
Press one key on any binding or behavior and Martha shows the file and line that caused it, with a toggle to turn it off.
Remembers who did what.
Undo survives restarts. Every edit is tagged with its author: you, a package, or an agent. Undo one author's work on its own.
Takes requests.
Describe a change in plain words. The reply arrives as Lua in a scratch buffer, your request kept as a comment above it. Nothing applies until you evaluate it. Any model, local or remote, or none.

Sessions

Lay out your windows once. martha --session NAME opens that session, or starts it if it is new. It keeps your open files, every split and its size, which window had focus, and terminals, which reopen as fresh shells in the same place.

Sessions are saved when you quit, or with C-c q w, as plain JSON in ~/.martha/sessions/.

What it is

A single binary that runs in any terminal, locally or over ssh. The core (buffers, undo, tree-sitter, terminal panes, the Lua VM) is Rust. The editor you actually use is about four thousand lines of Lua shipped inside it, and you can read, replace, or why any of it.

Your terminal draws the text, so your font, ligatures and colors are whatever you already chose. In terminals that speak the kitty keyboard protocol, Cmd shortcuts work too.

No accounts, no telemetry, no paid tier. Free software under the GPL.

Install

git clone https://github.com/Jordanlaubaugh9/Martha.git
cd Martha
cargo install --path .
martha --session work

Needs a Rust toolchain. Config lives in ~/.martha/init.lua.