mw

A terminal-first Markdown writing tool, in Rust.

Plain UTF-8 text with lightweight markup is canonical. The parse tree is a derived, disposable view — the text always wins. mw does not own layout: it delegates rendering to pandoc → XeLaTeX instead of reimplementing it. Plain text is the feature: line-diffable, greppable, ASCII-clean, yours forever.

Why it is the way it is

Two parsers, two jobs. tree-sitter drives live editing — syntax highlighting, folding, the outline, structural navigation. pandoc does export, and pulldown-cmark renders the instant preview. The editor is fast and TUI-first (ratatui + crossterm), amber-phosphor by default, with matrix-green and WordPerfect-blue themes a keypress away.

What it does

Highlight + outline + fold

tree-sitter Markdown: headings, emphasis, code, links; an outline sidebar (F3), heading jumps, and folding (F4/F5).

Instant live preview

F6 serves the in-memory buffer over a loopback port and updates as you type, preserving scroll.

Export

mw build → PDF via pandoc/XeLaTeX (or a project Makefile); also HTML / DOCX / EPUB. F7 builds in the background and jumps to errors.

Projects

An mw.toml manifest (compile order, title, bibliography) or a folder of sorted *.md; whole-book build, word count, search.

Citations + cross-refs

@key completion from .bib/CSL-JSON, undefined-reference flags, and Ctrl-] go-to-definition for @sec:/@fig:.

Writing quality

ASCII-discipline lint (smart-punctuation → ASCII with Ctrl-L), semantic line breaks, snippets, incremental search.

Math + focus

$…$ / $$…$$ render via KaTeX in preview and XeLaTeX at build; F8 typewriter mode dims everything but the current paragraph.

Language server

mw-lsp exposes the same diagnostics, outline, completion, and go-to-def to VS Code / Neovim / Helix.

Signing sidecar

mw can sign documents and build artifacts with Ed25519 in the minisign format — interoperable with the stock minisign and OpenBSD signify. Deliberately not ML-DSA / Dilithium: the "breakable keys" weakness is a property of ML-DSA's lattice keys and does not touch Ed25519.

mw keygen                     # -> ~/.config/mw/minisign.{key,pub}
mw sign report.pdf            # -> report.pdf.minisig
mw verify report.pdf          # or: minisign -Vm report.pdf -P RWQ…
mw build book/ --sign         # build, then sign the artifact

Download

Prebuilt v0.1.0 binaries — each archive holds the editor mw and the language server mw-lsp:

Linux

x86_64 · tar.gz
aarch64 · tar.gz
static musl, no runtime deps

macOS

Apple silicon · tar.gz
Intel · tar.gz

Windows

x86_64 · zip

Verify against the signed checksums (SHA256SUMS, .minisig). The signature is Ed25519 in the minisign format, so the stock minisign verifies it too:

curl -O https://mw.itys.net/dl/SHA256SUMS
curl -O https://mw.itys.net/dl/SHA256SUMS.minisig
minisign -Vm SHA256SUMS -P RWS4Ru+xtN2UWVLcfvEG8dobVwp2iWfAGmiWTliTO3Z3DUfvB/A3+Atb
sha256sum -c SHA256SUMS --ignore-missing       # or: mw verify SHA256SUMS

PDF export needs pandoc + a XeLaTeX (TeX Live) at runtime. Opening a new file seeds a starter scaffold with the date, author, and filename filled in.

Build from source

It is a Rust workspace; build the editor mw and the language server mw-lsp:

git clone https://git.itys.net/mjh/mw
cd mw
cargo build --release
./target/release/mw path/to/file.md            # amber theme (default)
./target/release/mw --theme matrix file.md     # matrix | wp

Requires a Rust toolchain.

Keys, at a glance