Surgical inline code editing for Neovim, powered by AI.
Select code, describe what you want, and chisel refines it in place — no chat windows, no diff previews, no context switching. One instruction, one edit, done.
- Select code in visual mode (or use
:ChiselFilefor whole-file context) - Describe the change you want in plain English
- Wait — a spinner overlays the selected lines while the AI works
- Done — your file is updated in place
chisel delegates the actual editing to an AI CLI tool (currently Claude CLI, with Codex support planned). The AI receives your selection, your instruction, and uses its Edit tool to surgically modify the file on disk. The buffer reloads automatically.
- Refactor — "extract this into a helper function"
- Fix — "this has an off-by-one error"
- Transform — "convert to async/await"
- Explain — "add comments explaining this logic"
- Generate — "add error handling for the network call"
- Neovim >= 0.10
- snacks.nvim — input prompt, floating windows, notifications
- fidget.nvim — progress indicator
- Claude CLI — must be installed and on your
PATH
{
"yourusername/chisel.nvim",
dependencies = {
"folke/snacks.nvim",
"j-hui/fidget.nvim",
},
keys = {
{ "<leader>ci", ":Chisel<CR>", mode = "v", desc = "Chisel selection" },
{ "<leader>ci", ":ChiselFile<CR>", mode = "n", desc = "Chisel file" },
},
config = function()
require("chisel").setup()
end,
}All options are optional. Defaults:
require("chisel").setup({
keymap = "<leader>ci",
exclude_filetypes = { "oil" },
backend = "claude", -- "claude" (codex planned)
claude = {
cmd = "claude",
args = {
"--verbose",
"--output-format", "stream-json",
"--include-partial-messages",
"--no-session-persistence",
},
},
ui = {
spinner = {
hl_group = "DiagnosticVirtualTextWarn",
},
},
})| Command | Description |
|---|---|
:Chisel |
Edit selected lines (visual mode) |
:ChiselFile |
Edit with whole-file context (normal mode, cursor provides location hint) |
:ChiselAbort |
Cancel the active session |
:ChiselReview |
Toggle a float showing the last response |
Uses the claude CLI with streaming JSON output. Claude receives your selection as context and edits the file directly using its Edit tool with --dangerously-skip-permissions.
OpenAI Codex CLI support is on the roadmap.
Logs are written to vim.fn.stdpath("log") .. "/chisel.log" and cleared each run. Check this file if edits aren't applying or the spinner hangs.