A minimal Neovim plugin for Claude Code integration. One command, no fluff.
- Neovim >= 0.5
- Claude Code CLI installed
Using lazy.nvim:
{
"pauldub/claude-code-nvim",
config = function()
require('claude-code').setup({
-- Optional configuration
timeout = 60000, -- milliseconds (default: 1 minute)
split_direction = "horizontal", -- or "vertical"
output_format = "json", -- "text", "json", or "stream-json"
show_metadata = false -- show cost/duration info
})
end
}
:Claude <your prompt>
Examples:
:Claude explain this function
:Claude refactor for better performance
:Claude write tests for this code
Select code and run :Claude
to analyze it:
- Select code in visual mode (
v
,V
, or<C-v>
) - Type
:Claude
(or:'<,'>Claude
) - Optionally add a prompt:
:'<,'>Claude explain this function
When used in visual mode:
- Without prompt: sends just the selected code
- With prompt: sends both your prompt and the selected code
The output will open in a new split buffer with markdown syntax highlighting.
- Type Annotations: Full LuaLS annotations for autocomplete and type checking
- Documentation: Access help with
:h claude-code
- Testing: Run tests with
./run_tests.sh
require('claude-code').setup({
timeout = 120000, -- Timeout in milliseconds (default: 60000 = 1 minute)
split_direction = "vertical", -- Split direction: "horizontal" or "vertical"
output_format = "json", -- Output format: "text", "json" (default), or "stream-json"
show_metadata = true, -- Show cost and timing info (default: false)
debug = false, -- Enable debug logging (default: false)
-- Tool restrictions (optional)
allowed_tools = "Bash,Edit,Read", -- String or array of allowed tools
disallowed_tools = { -- String or array of disallowed tools
"Bash(git push)",
"Bash(rm -rf)",
"Write"
}
})
Control which tools Claude can use:
-
allowed_tools: Whitelist specific tools or commands
"Bash"
- allow all Bash commands"Bash(npm install)"
- allow only specific commands"mcp__filesystem__*"
- allow MCP tool patterns
-
disallowed_tools: Blacklist dangerous operations
"Bash(git commit)"
- prevent git commits{"Write", "Delete"}
- prevent file modifications
## License
MIT