Your Neovim AI Sidekick is Here
If you live in Neovim, you've probably felt the pull of AI coding assistants. They're powerful, but constantly switching between your editor and a browser tab can shatter your flow. What if that assistant lived right inside your editor, context-aware and ready on demand? That's exactly the promise of sidekick.nvim.
It's not just another plugin that calls an API. Sidekick.nvim is a framework designed to be your AI companion, deeply integrated into your Neovim workflow. It manages conversations, context, and multiple AI providers, all from the comfort of your favorite editor.
What It Does
Sidekick.nvim is a Neovim plugin that brings a structured, chat-based AI assistant directly into your editor. Think of it as a dedicated AI pair programmer that sits in a sidebar. You can ask it questions, request code changes, or have it explain snippets, and it interacts with the code you're actively working on. It maintains conversation history per project and supports multiple AI backends, so you're not locked into a single provider.
Why It's Cool
The magic of sidekick.nvim is in its integration and design. It feels less like a external tool and more like a native part of Neovim.
- Context-Aware by Default: It can automatically include relevant context—like the current file, diagnostics, or even a tree-sitter query of the code under your cursor—when you ask a question. This means less copying and pasting and more useful answers.
- Provider Agnostic: It comes with built-in support for OpenAI, Anthropic (Claude), and Google's Gemini. You can configure your preferred one and even set up fallbacks.
- Conversations with Memory: Each Neovim tab gets its own conversation history. You can have a deep discussion about refactoring a module in one tab and a separate chat about debugging a test in another, and neither interferes with the other.
- It's a Framework: The plugin provides a solid foundation. You can create custom "tasks" or "prompts" for specific workflows, and its architecture means other plugins can build on top of it, extending its capabilities.
How to Try It
Ready to give it a spin? If you use a plugin manager like lazy.nvim, adding sidekick.nvim is straightforward.
First, add it to your plugin spec:
{
"folke/sidekick.nvim",
opts = {
-- Your configuration here
providers = {
openai = { api_key = os.getenv("OPENAI_API_KEY") },
-- anthropic = { api_key = os.getenv("ANTHROPIC_API_KEY") },
-- google = { api_key = os.getenv("GEMINI_API_KEY") },
}
},
keys = {
-- Open/close the sidekick
{ "<leader>sk", "<cmd>Sidekick<cr>", desc = "Toggle Sidekick" },
-- Open with the current selection as context
{ "<leader>ss", "<cmd>Sidekick context=visual<cr>", desc = "Sidekick (Visual)" },
},
}
You'll need to set an environment variable with your chosen AI provider's API key. Once installed, hitting <leader>sk (or your mapped key) will open the sidekick panel and you can start chatting.
For detailed setup, including model selection and context configuration, check out the sidekick.nvim GitHub repository.
Final Thoughts
Sidekick.nvim moves past the gimmick phase of AI in editors. It provides a thoughtful, integrated environment for having a sustained, contextual dialogue with an AI about your code. It won't write your entire app for you, but it can be an incredible tool for brainstorming, explaining complex code, or working through a tricky refactor without leaving your mental state.
If you're already using an AI assistant but tired of the tab-switching dance, this plugin is absolutely worth the setup. It turns a powerful but disjointed tool into a true sidekick.
Follow for more curated projects: @githubprojects