Claude Code Neovim Plugin integrates Claude Code AI assistant with Neovim. It enables developers to use Claude Code directly within Neovim for code generation, debugging, and refactoring. The plugin connects to the Claude Code API and provides a workflow for developers who prefer using Neovim as their primary code editor.
git clone https://github.com/greggh/claude-code.nvim.githttps://github.com/greggh/claude-code.nvim
[{"step":"Install claude-code.nvim in your Neovim configuration (using packer.nvim, lazy.nvim, or your preferred plugin manager). Add the plugin and configure it with your Claude Code API key.","tip":"Ensure you have the latest version of Neovim (0.9+) and Node.js installed for full functionality."},{"step":"Open the file you want to work on in Neovim. Use the `:Claude` command followed by your task description. For example: `:Claude Refactor the authentication middleware in src/middleware/auth.py to use async/await.`","tip":"Be specific with your requests. Include file paths, desired changes, and any constraints (e.g., 'keep the same API signature')."},{"step":"Review the changes suggested by claude-code.nvim. The plugin will display a diff in a new buffer. Use `:diffget` and `:diffput` to accept/reject changes interactively.","tip":"Use `:Claude undo` to revert all changes if needed. The plugin maintains a history of all modifications."},{"step":"Save the changes and run your test suite to verify the modifications. Use `:Claude test` to run tests directly from Neovim.","tip":"For complex changes, break them into smaller tasks and use `:Claude` iteratively to avoid overwhelming the AI."},{"step":"Commit the changes to version control. Use `:Claude commit` to generate a commit message based on the changes made.","tip":"Always review the generated commit message before finalizing. Adjust if needed to match your team's conventions."}]
Quickly generate code snippets or entire functions using Claude Code while coding in Neovim.
Resume previous AI conversations to continue coding discussions without losing context.
Automatically reload modified files in Neovim, ensuring that the latest changes are always reflected.
Utilize AI to debug code by asking for explanations or suggestions directly in the terminal.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/greggh/claude-code.nvimCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use claude-code.nvim to [TASK] in Neovim. For example: 'Refactor the Python function at src/utils/helpers.py to use list comprehensions instead of loops. Ensure the functionality remains identical and add type hints.' Or 'Add unit tests for the new API endpoint in src/routes/users.py using pytest. Include edge cases for invalid inputs.'
```lua
-- claude-code.nvim output:
-- Refactored src/utils/helpers.py to use list comprehensions
-- Changes made:
-- 1. Replaced loop in `filter_even_numbers` with list comprehension
-- 2. Added type hints to all functions
-- 3. Maintained identical behavior (verified with existing tests)
-- New implementation:
def filter_even_numbers(numbers: list[int]) -> list[int]:
return [n for n in numbers if n % 2 == 0]
-- Unit tests added in tests/test_helpers.py:
# test_filter_even_numbers.py
from utils.helpers import filter_even_numbers
def test_filter_even_numbers():
assert filter_even_numbers([1, 2, 3, 4]) == [2, 4]
assert filter_even_numbers([]) == []
assert filter_even_numbers([1, 3, 5]) == []
assert filter_even_numbers([-2, 0, 2]) == [-2, 0, 2]
-- Verification:
-- ✅ All existing tests pass (pytest tests/)
-- ✅ New tests cover edge cases
-- ✅ Type hints added and validated with mypy
```
The refactored code is now 30% faster and maintains full backward compatibility. The unit tests ensure the new implementation handles all edge cases correctly.Access telematics data in trucking
AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan