
claude code nvim
为 Neovim 提供基于 Claude AI 的代码辅助功能。
Repository Info
About This Server
为 Neovim 提供基于 Claude AI 的代码辅助功能。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
claude-code.nvim
A minimal Neovim plugin for Claude Code integration. One command, no fluff.
Requirements
- Neovim >= 0.5
- Claude Code CLI installed
Installation
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
}
Usage
Normal Mode
:Claude <your prompt>
Examples:
:Claude explain this function:Claude refactor for better performance:Claude write tests for this code
Visual Mode
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.
Developer Experience
- Type Annotations: Full LuaLS annotations for autocomplete and type checking
- Documentation: Access help with
:h claude-code - Testing: Run tests with
./run_tests.sh
Configuration
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"
}
})
Tool Restrictions
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
Quick Start
Clone the repository
git clone https://github.com/pauldub/claude-code-nvimInstall dependencies
cd claude-code-nvim
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.