sidekick.nvim integrates Copilot LSP's Next Edit Suggestions with a built-in terminal for AI CLI. Review and apply diffs, chat with AI assistants, and streamline coding without leaving Neovim. Benefits developers by reducing context switching and improving productivity.
git clone https://github.com/folke/sidekick.nvim.githttps://github.com/folke/sidekick.nvim
[{"step":"Install and configure sidekick.nvim","action":"Ensure you have Neovim (>=0.9) and Copilot LSP installed. Add sidekick.nvim to your plugin manager (e.g., Lazy.nvim) with the following configuration in your `init.lua`:\n```lua\nrequire('sidekick').setup({\n copilot_enabled = true,\n terminal_integration = true,\n keybinds = {\n apply_all = '<leader>aa',\n apply_hunk = '<leader>ac',\n reject_hunk = '<leader>ar',\n toggle_chat = '<leader>as',\n open_terminal = '<leader>at',\n }\n})\n```"},{"step":"Open a file and trigger AI suggestions","action":"Open a file in Neovim (e.g., `src/utils.py`). Sidekick.nvim will automatically detect the file type and suggest edits via Copilot LSP. Use `:SidekickNext` to cycle through suggestions or `:SidekickChat` to open the chat interface."},{"step":"Review and apply diffs","action":"Navigate the diffs using Neovim’s built-in motions (`]c` and `[c`). Use the keybinds configured in step 1 to apply or reject changes. For example, `<leader>aa` applies all diffs, while `<leader>ac` applies the current hunk."},{"step":"Use the terminal for testing or CLI tasks","action":"Open the integrated terminal with `<leader>at` (or your configured keybind). Run tests, linting, or other CLI commands directly from Neovim. The terminal output is captured in a buffer for easy review."},{"step":"Chat with the AI for clarification","action":"If you’re unsure about a suggestion, use `<leader>as` to open the chat interface. Ask specific questions like, \"Why is this change recommended?\" or \"How do I test this refactor?\" The AI will respond with detailed explanations."}]
Receive intelligent code suggestions in real-time as you write code.
Interact with AI command-line tools like Claude and Codex directly from Neovim.
Automatically visualize code changes with rich diffs and inline highlighting.
Utilize a library of pre-defined prompts for common coding tasks.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/folke/sidekick.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 sidekick.nvim in Neovim to [ACTION] in [FILE_TYPE]. For example: 'Use sidekick.nvim to refactor the Python class in src/utils.py to follow PEP 8 guidelines. Review the diffs and apply the changes.'
Here’s how sidekick.nvim would assist with your request to refactor the Python class in `src/utils.py`:
1. **Next Edit Suggestions**: Sidekick.nvim detects the Python file and suggests a refactor to align with PEP 8. The AI assistant highlights the class `DataProcessor` and proposes:
```python
class DataProcessor:
def __init__(self, input_data):
self.input_data = input_data
def process(self):
# Logic here
pass
```
becomes:
```python
class DataProcessor:
def __init__(self, input_data):
self.input_data = input_data
def process(self):
# Logic here
pass
```
2. **Review Diffs**: The diff view in Neovim shows the changes side-by-side. You can navigate between hunks using `]c` and `[c` (standard Neovim motions). Sidekick.nvim also provides a summary of the changes:
- Added blank line after `__init__` method (PEP 8 compliance).
- No functional changes; purely stylistic.
3. **Apply Changes**: Press `<leader>aa` (default keybind for "Apply All" in sidekick.nvim) to accept all diffs. Alternatively, use `<leader>ac` to accept the current hunk or `<leader>ar` to reject it.
4. **Terminal Integration**: If you need to test the changes, open the built-in terminal with `<leader>at` and run:
```bash
python -m pytest tests/test_utils.py -v
```
The terminal buffers the output, so you can review test results without leaving Neovim.
5. **Chat with AI**: If you’re unsure about the refactor, open the chat interface with `<leader>ac` and ask:
"Is this PEP 8 refactor correct? Should I add type hints?"
The AI responds with:
```
The refactor is correct for PEP 8. Adding type hints is optional but recommended for better code clarity. Example:
```python
def __init__(self, input_data: list[str]) -> None:
```
After applying the changes, save the file with `:w` and continue coding seamlessly.The browser that works for you
Hey, what’s on your mind today?
AI-powered lesson planning and student analytics
Get more done every day with Microsoft Teams – powered by AI
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan