share your neovim context with agents through visual mode
vision.nvim lets Visual mode act as the bridge between your editor context and your agents. When you prompt your agent from Visual mode, it automatically attaches the relevant Neovim context from the active editor state.
User prompt
-> agent integration runs visionctl hook <provider>
-> visionctl connects to the matching vision.nvim session
-> vision.nvim captures Visual-mode editor context
-> visionctl renders provider-specific context
-> agent receives it with the prompt
- User prompt: The message you submit to the agent.
- Agent integration: The provider-specific hook/plugin installed by
:VisionInstall <provider>. It runs when you submit a prompt. - vision.nvim session: A registered live endpoint for a Neovim instance. It includes a local socket/TCP listener plus a JSON discovery record on disk.
- visionctl: The short-lived command-line bridge. It finds the matching vision.nvim session, asks that Neovim process for Visual-mode context, renders the result, and returns it to the agent.
- vision.nvim: The Lua plugin running inside Neovim. It owns editor state: Visual mode state, selection range, current file, cursor, line, diagnostics.
{
"azorng/vision.nvim",
config = function()
require("vision").setup({})
end,
}vim.pack.add({
"https://github.com/azorng/vision.nvim",
})
require("vision").setup({})Then install a provider integration from inside Neovim:
:VisionInstall codex
:VisionInstall claude
:VisionInstall cursor
:VisionInstall opencode
:VisionInstall pivision.nvim installs provider integrations by editing the corresponding agent config:
- Codex: adds a prompt hook in
~/.codex/hooks.json. - Claude: adds a prompt hook in
~/.claude/settings.json. - Cursor: adds a session-start hook in
~/.cursor/hooks.json. - OpenCode: writes a managed plugin to
$OPENCODE_CONFIG_DIR/plugins/vision-nvim.js, or~/.config/opencode/plugins/vision-nvim.jsby default. - Pi: writes a managed extension to
$PI_CODING_AGENT_DIR/extensions/vision-nvim.ts, or~/.pi/agent/extensions/vision-nvim.tsby default.
After installing an integration, restart any already-running agent session so the agent reloads its config.
Enter Visual mode in Neovim when submitting your prompt. The integration will attach the context automatically.
If not in Visual mode, no context will be attached.
-- Default configuration with all available options
require("vision").setup({
selection = {
clear_after_send = true,
},
context = {
current_file = true,
cursor = false,
current_line = false,
diagnostics = false,
},
})