xmd helps you work with AI chat transcripts as editable files in Vim.
Instead of treating a chat as a disposable terminal session, xmd stores the
conversation in a *.x.md file and lets you keep editing, re-running, and
restructuring it like normal text.
xmd is for the case where you want:
- a chat transcript you can inspect and version
- repeatable prompts that stay attached to the file they belong to
- a way to send the current file to a model without copying content around
- optional tool calls and arena-style multi-model runs, while keeping the transcript readable in Vim
In short: it turns AI chat into a file-based workflow instead of an opaque UI session.
Here is the same *.x.md file as it moves through the workflow:
# User -> qwen3.5-27b
Write a short launch note for the new release.
# User -> qwen3.5-27b
Write a short launch note for the new release.
# model: qwen3.5-27b [4s]
We are shipping the new release today. It is faster, more focused, and
ready for daily use.
# User -> qwen3.5-27b
Find the current date and include it in the release note.
# tool calls: qwen3.5-27b [3s]
```json
[
{
"type": "function",
"function": {
"name": "get_date_time",
"arguments": {}
}
}
}
```
# tool: get_date_time
```json
{}
```
2026-04-11 22:54:00 CEST
# model: qwen3.5-27b [5s]
We are shipping the new release today, on 2026-04-11, with a simpler and
faster workflow.
This is the shape xmd keeps in the file: human-written prompts, model replies, and tool traces all live together in one editable transcript.
The CLI talks to Ollama. Right now that is the only supported backend.
A typical flow looks like this:
- Start the queue worker in one terminal:
xmd worker- Keep a second terminal open as a lightweight HUD:
watch xmd status- Create or open a
*.x.mdtranscript in Vim. - Edit the prompt, model blocks, or tool-call transcript as plain text.
- Send the current file to the model:
xmd send path/to/file.x.md- If you want the next authoring action instead of a send, ask for it:
xmd suggest path/to/file.x.md --jsonOther CLI commands:
xmd new topicxmd modelsxmd lsxmd status
The Vim plugin adds buffer-local behavior for *.x.md files.
When you open a *.x.md file, Vim applies xmd behavior automatically.
Use these exact mappings and commands:
[sto jump to the previous section]sto jump to the next sectionzTto fold every<think>...</think>block<leader>xsto write and send the current buffer<leader>xmto write and send the current buffer with a chosen model<leader>xlto list files in the current directory:Xmdto ask for the next authoring action and append it:XmdSendto send the current buffer through the CLI:XmdSelectModelto insert a model name at the cursor
The doc/xmd.txt help file describes the full file format, commands, and
mappings.
Install this repository as a Vim plugin using your normal plugin manager or a
manual runtimepath setup.
Then generate help tags:
:helptags {path-to-xmd}/doc
:help xmdThe CLI executable is xmd. Put it on your PATH, or invoke it from the
repository root.
xmd reads runtime files from XMD_HOME, which defaults to ~/.xmd.
Common configuration points:
XMD_HOME- runtime state, queue files, tool specs, and the default system prompt
XMD_DEFAULT_MODEL- fallback model when a file does not specify one
LLAMA_SWAP_URL- base URL for the backend API, defaulting to
http://localhost:11434
- base URL for the backend API, defaulting to
XMD_TOOLS_FILE- optional explicit JSON file with tool definitions
If you want the optional contrib bundle, copy the pieces you want into your
own XMD_HOME:
mkdir -p "$XMD_HOME"
cp -R contrib/bin "$XMD_HOME/"
cp -R contrib/tools.d "$XMD_HOME/"
cp -R contrib/system_prompt.txt "$XMD_HOME/"autoload/,after/,syntax/,ftplugin/: Vim integrationxmd: CLI executabledoc/xmd.txt: Vim helptest_xmd.sh,test_vim_xmd.sh: testscontrib/: optional, unsupported extras you can install manually