opencode.nvim is a Neovim plugin that integrates the opencode AI coding assistant directly into the editor, enabling developers to interact with AI agents in a deeply context-aware and workflow-native way. It allows users to send prompts that automatically include relevant editor context such as the current buffer, selected text, diagnostics, and visible content, making AI interactions far more precise and useful during development. The plugin supports a prompt library system, allowing developers to reuse predefined prompts or create custom ones tailored to their workflows. It also enables direct execution of AI-driven actions, such as code modifications or command execution, while giving users full control to review, accept, or reject changes through diff-based interfaces. The system integrates with an in-process Language Server Protocol implementation, enabling familiar features like hover explanations and code actions powered by AI.
Features
- Context-aware prompts using buffer selection and diagnostics
- Integration with Language Server Protocol for AI-powered code actions
- Prompt library system with reusable and customizable templates
- Diff-based interface to review and accept AI edits
- Event-driven automation with editor hooks
- Seamless integration with Neovim workflows and keybindings