whereismyai
opencode.nvim
opencode.nvim is a Neovim plugin that integrates with OpenCode to provide AI-assisted coding context and interaction directly within the editor.
This Neovim plugin connects to an OpenCode server to facilitate AI-assisted coding without changing existing editor workflows. It injects editor context, such as current buffers, selections, diagnostics, and marks, into prompts sent to the OpenCode daemon. Users can select from built-in prompts like document, implement, and fix, or execute custom OpenCode commands. When OpenCode proposes file edits, the plugin displays these changes using Neovim's diffpatch functionality for side-by-side review. It includes support for integrations like snacks.nvim and blink.cmp to handle inputs, completions, and status lines. The plugin handles Server-Sent-Events from OpenCode to manage permission requests and real-time buffer reloads.
opencode.nvim at a glance
Key features
- Connects to existing OpenCode servers or starts local instances
- Injects editor context including selections, buffers, and diagnostics
- Provides built-in and custom prompt templates for code modification
- Displays proposed file edits in side-by-side diff views
- Handles OpenCode permission requests within Neovim
- Supports autocompletion and input via snacks.nvim and blink.cmp
- Maps OpenCode events to Neovim autocmds
Use it for
- Generating documentation for selected code blocks
- Applying performance and readability optimizations
- Adding unit tests for specific functions or modules
- Reviewing code for correctness and readability
- Fixing reported diagnostics within the editor
Companions
Tools that articles about opencode.nvim recommend using with it, each with its job.
- OpenCode — Built to work with OpenCode.
- Context7 — Provides up-to-date documentation for AI agents and code editors.
- Ollama — Run local models at zero marginal cost, with code kept on your machine.
- OpenRouter — Access over 500 models and 80 providers through one unified API.
- Daytona — Runs sessions in isolated sandboxes synced to git branches.
- Composio — Equips AI agents with tools, managed user auth, and sandboxes across 1,500+ apps
Alternatives to opencode.nvim
- CodeCompanion — Provides native AI integration and agent support directly within Neovim.
- claudecode.nvim — Adds native AI coding assistant functionality to Neovim.
- Atlas.nvim — Manage code reviews and issues directly inside your Neovim editor.
- OpenCursor — Connects multi-provider LLMs or local models for agentic coding directly inside VS Code.
- sidekick.nvim — Integrates Copilot Next Edit Suggestions and AI command-line tools inside Neovim.
- ModLens — Converts screenshots and charts into structured JSON data for coding agents.
- OpenClaude — Connects one terminal interface to over 200 different AI models.
- jevgrep — Reduces coding agent costs by providing targeted, relevant repository context.
- CopilotChat.nvim — Integrates GitHub Copilot chat into Neovim with tool calling and custom providers.
- README AI — Automates documentation creation from codebases with custom styles.
- Oh My OpenCode Slim — It orchestrates specialized sub-agents for domain-specific coding tasks.
- Hypervibe — Run multiple AI coding agents in parallel on a single visual board using your own subscriptions.
All opencode.nvim alternatives