Neovim plugin for AI-assisted inline code editing via Claude Code CLI. Select text, describe what you want, get results — all without leaving your code flow.
- Neovim 0.10+
- Claude Code CLI installed and available in PATH
{
"heliotik/botglue.nvim",
config = function()
require("botglue").setup()
end,
}use {
"heliotik/botglue.nvim",
config = function()
require("botglue").setup()
end,
}require("botglue").setup({
model = "opus", -- default model
models = { "opus", "sonnet", "haiku" }, -- available for cycling
default_keymaps = true, -- register <leader>pp
timeout = 300, -- seconds (5 min), auto-cancel
max_turns = 3, -- Claude tool-use turns limit
ai_stdout_rows = 5, -- lines of Claude activity in top extmark
})| Keymap | Command | Action |
|---|---|---|
<leader>pp |
:Botglue |
Open three-panel UI: history + prompt editor |
- Select code in visual mode (
v,V, or<C-v>) - Press
<leader>pp - Three-panel UI opens: filter, history list (sorted by frequency), prompt editor
- Browse history with
j/k, press/to filter, orTabto prompt editor Enteron a history item populates the prompt editor for editingCtrl+Ssubmits — from history list (quick submit) or from prompt editor.Enterin normal mode also submits from prompt editor- Inline progress extmarks appear around selection, result replaces it
History list (Panel 2):
j/k— navigate, preview shown in prompt editorEnter— select and move to prompt editorCtrl+S— quick submit without editing/— open filterTab— move to prompt editorEsc/q— close
Filter (Panel 1):
- Type — fuzzy filter history list with match highlighting
Ctrl+J/Ctrl+K— navigate list without leaving filterEnter— select top match, move to prompt editorEsc— clear filter, return to listTab— move to prompt editor
Prompt editor (Panel 3):
Enter— new line (insert mode) / submit (normal mode)Ctrl+S— submit prompt (any mode)Shift+Tab— cycle model (opus -> sonnet -> haiku)Tab— return to history listq/Esc— close (normal mode)
While processing, extmarks appear above and below your selection showing a spinner and Claude's activity (tool calls). The selection remains untouched until the result arrives.
lua/botglue/
init.lua -- setup(), run(), keymap registration
config.lua -- defaults (models, timeout, max_turns)
picker.lua -- three-panel float UI: filter, history, prompt
ui.lua -- prompt editor window factory, model cycling
operations.lua -- visual selection handling, run orchestration
claude.lua -- CLI command builder, stream-json parser
display.lua -- extmark-based inline progress (spinner, tool activity)
history.lua -- JSON persistence with frequency sorting
UI layout: A single container frame ("BotGlue" title, model badge footer) holds three borderless inner panels separated by labeled dividers. Active panel indicated by yellow divider highlight. Autocomplete disabled in all panels. When history is empty, only the prompt editor opens.
If you disable default keymaps:
require("botglue").setup({ default_keymaps = false })
vim.keymap.set("x", "<leader>pp", require("botglue").run, { desc = "Botglue: run" })make fmt # format with stylua
make lint # run luacheck
make test # run 80 tests with plenary.nvim
make pr-ready # lint + test + format checkAI as a tool for precise inline editing, not an autonomous agent. Inspired by ThePrimeagen/99.
MIT