Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Neovim plugin for Gemini, Qwen, and Claude Code
This plugin adds an AI sidebar and terminal workflow to Neovim for Gemini, Qwen, and Claude Code. It auto-detects installed CLIs, opens persistent sessions in the editor or tmux, and routes selections, file context, and diagnostics to the agent. It also handles diff review inside Neovim, so you can accept or reject suggestions with normal save and quit actions. Claude Code support uses an MCP backend with lock-file discovery and auth, while Gemini and Qwen use the same editor workflow.

Builders who use Neovim and want reusable agent sessions, context, and diffs inside the editor.
You can keep AI coding sessions, file context, and change review inside Neovim instead of switching tools.
What it does
Sidebar chat and terminal sessions
Opens an AI sidebar or a dedicated terminal session for Gemini, Qwen, or Claude Code.
Multi-agent detection
Auto-detects installed `gemini`, `qwen`, and `claude` CLIs and lets you pin the set you want in `cmds`.
Diff accept and reject flow
Shows suggested edits as diffs and lets you accept or reject them with `:w`, `:wq`, `:q`, or plugin commands.
Selection and diagnostics handoff
Sends selected text, line diagnostics, and file diagnostics to the agent for editing or debugging help.
Tmux session support
Can run agents in persistent tmux sessions so they keep state across Neovim restarts.
Claude Code MCP integration
Connects Claude Code through a WebSocket MCP server with lock-file discovery and per-session auth.
Sidebar style customization
Supports right, left, bottom, and floating sidebar presets with configurable size and key bindings.
How to get it
- 1Run tests with
XDG_CONFIG_HOME=./tests nvim --headless -c "PlenaryBustedDirectory tests"
README
nvim-gemini-companion
๐ Now with Triple Agent Support (Gemini, Qwen & Claude Code)! ๐ค
nvim-gemini-companion brings the power of AI agents like Gemini, Qwen and Claude Code directly into your Neovim workflow. ๐ Enjoy seamless diff views, agent management, and smart file modifications without leaving your editor. Inspired by the vscode-gemini-companion extension
Unlike other Gemini plugins for Neovim, nvim-gemini-companion is built around the MCP backend, which keeps your editor session tightly integrated with your IDE for much better experience โจ
https://github.com/user-attachments/assets/90370aa6-1ae2-477c-8529-0f26e32bdff8
๐ Quick Start
Pre-requisites
Install any (or all) of these CLI tools and ensure they're in your system's PATH:
The plugin auto-detects which of these are installed, so no extra configuration is needed to get started.
Installation
Install with your favorite plugin manager:
{
"gutsavgupta/nvim-gemini-companion",
dependencies = { "nvim-lua/plenary.nvim" },
event = "VeryLazy",
config = function()
require("gemini").setup()
end,
keys = {
{ "<leader>gg", "<cmd>GeminiToggle<cr>", desc = "Toggle Gemini sidebar" },
{ "<leader>gc", "<cmd>GeminiSwitchToCli<cr>", desc = "Spawn or switch to AI session" },
{ '<leader>gS', '<cmd>GeminiSend<cr>', mode = { 'x' }, desc = 'Send selection to Gemini' },
}
}
๐ ๏ธ Essential Commands & Features
Core Commands
:GeminiToggle- Toggle the AI sidebar:GeminiSwitchToCli- Spawn or Switch to tmux/sidebar sessions:GeminiSend- Send selected text to AI (use in visual mode):GeminiSendLineDiagnostic- Send line diagnostics to AI:GeminiSendFileDiagnostic- Send file diagnostics to AI:GeminiSwitchSidebarStyle- Switch the appearance/style of the sidebar
Sidebar Terminal Switching
When multiple commands are configured (e.g., both gemini and qwen), you can switch between active sidebar terminals using default key mappings:
<M-]>- Switch to the next active terminal (Alt + ])<M-[>- Switch to the previous active terminal (Alt + [)
To customize these key bindings, you can override the default mappings in your setup function:
require("gemini").setup({
cmds = { "gemini", "qwen" },
-- Override default key mappings
on_buf = function(buf)
-- Add your own custom mappings
vim.api.nvim_buf_set_keymap(buf, 't', '<Tab>',
'<Cmd>lua require("gemini.ideSidebar").switchSidebar()<CR>',
{ noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(buf, 't', '<S-Tab>',
'<Cmd>lua require("gemini.ideSidebar").switchSidebar("prev")<CR>',
{ noremap = true, silent = true }
)
end
})
Note: Be aware that <Tab> and <S-Tab> may already be mapped to other functionality by the Gemini/Qwen CLIs themselves, so using these keys for terminal switching might interfere with their built-in features. Consider using alternative key bindings such as <C-Tab> and <C-S-Tab> or the default Alt-based mappings instead.
Diff Management
When AI suggests changes, you can:
:wor:wq- Accept changes:qor:q!- Reject changes:GeminiAccept/:GeminiReject- Plugin-specific commands
Tmux Integration (Optional)
Run AI agents in persistent tmux sessions:
:GeminiSwitchToCli tmux gemini- Use Gemini in tmux:GeminiSwitchToCli sidebar qwen- Use Qwen in sidebar
๐๏ธ Customization Options
Sidebar Styles
Choose from multiple sidebar presets:
require("gemini").setup({
win = {
preset = "floating", -- Options: "right-fixed", "left-fixed", "bottom-fixed", "floating"
width = 0.8,
height = 0.8,
}
})
Multi-Agent Support
By default the plugin auto-detects which agents are installed (gemini, qwen, claude) and enables all of them โ so most users don't need to set cmds at all. An explicit cmds/cmd always takes precedence over auto-detection:
require("gemini").setup() -- auto-detect installed agents (recommended)
require("gemini").setup({ cmds = { "claude" } }) -- use only Claude Code
require("gemini").setup({ cmds = { "gemini", "qwen", "claude" } }) -- pin all three
Claude Code: the Claude integration uses a WebSocket MCP server with lock-file discovery (under
~/.claude/ide/) and a per-session auth token. It starts automatically only whenclaudeis both installed and part of the effectivecmds. Launchclaudefrom the sidebar/tmux and it connects on its own โ diffs, selection, open editors, and diagnostics all work out of the box.
โ๏ธ Advanced Configuration
Enhanced Picker Integration
Replace default selection UI with fzf-lua/telescope:
-- For fzf-lua integration
vim.ui.select = function(items, opts, onChoice)
require('fzf-lua').fzf_exec(items, {
prompt = opts.prompt or 'Select from items',
actions = {
['default'] = function(selected) onChoice(selected[1]) end,
},
winopts = { height = math.min(0.2 + #items * 0.05, 0.6) },
})
end
Key Mappings for Quick Access
keys = {
{ "<leader>g1", "<cmd>GeminiSwitchToCli tmux gemini<cr>", desc = "Tmux Gemini" },
{ "<leader>g2", "<cmd>GeminiSwitchToCli tmux qwen<cr>", desc = "Tmux Qwen" },
{ "<leader>gs", "<cmd>GeminiSwitchSidebarStyle<cr>", desc = "Switch sidebar style" },
}
๐ธ Screenshots

โจ Key Features
- Diff Control: Auto diff views, accept or reject suggestions directly from vim using
:wqor:q. - CLI Agent: Dedicated terminal session for interacting with AI agents
- Multi-Agent Support: Run
gemini,qwen-code, andclaude-codeagents simultaneously - Claude Code Integration: WebSocket MCP transport with lock-file discovery + auth; auto-connects, native diffs, live context
- Tmux Integration: Persistent sessions with state across nvim restarts
- Context Management: Tracks open files, cursor position, and selections for AI context
- LSP Diagnostics: Send file/line diagnostics to AI agents for enhanced debugging
- Visual Selection: Send selected text + prompt directly to AI agents using
:GeminiSend - Flexible Sidebar: Choose between
right-fixed,left-fixed,bottom-fixed, orfloatingstyles - Highly Customizable: Configure commands, window styles, and key bindings to your liking
๐ง For Developers
Run tests with:
XDG_CONFIG_HOME=./tests nvim --headless -c "PlenaryBustedDirectory tests"
๐ Roadmap
- Amazon-cli agent
- More cli-agents (similar to gemini-cli or forked versions)
- ACP Protocol: Implement ACP protocol support for deeper integration.
Files in the repo
- .gemini
- .github
- assets
- lua
- tests
- .qwen
- .stylua.toml
- GEMINI.md
- README.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More plugins

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
OmO: Just type "mass ulw" keyword with your prompt. Now you are the master of graph engineering.
Persistent Context Across Sessions for Every Agent โ Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Opinionated Oxlint rules for rejecting low-evidence TypeScript and JavaScript patterns
Teams-first Multi-agent orchestration for Claude Code