Favicon of gp.nvim

gp.nvim

An AI plugin brings chat and code editing to Neovim, with offline models through Ollama and support for Claude, Gemini and OpenAI APIs.

Alternative to:

gp.nvim brings AI chat and prompt-based editing into Neovim for developers and writers who want to work with their existing buffers. You can ask about selected text or code, then apply the response inside the editor.

  • Saved chats: Keep conversations in autosaved Markdown buffers, add context from multiple files, and search or preview past sessions in a chat finder.
  • Text and code editing: Ask for rewrites, additions or code completion, with results placed in the current text, a separate buffer or a popup; responses stream as they arrive, and you can cancel generation or undo a response in one action.
  • Project instructions: Give the model repository-specific conventions and create reusable commands for tasks such as explanations, code review or test generation.
  • Voice input: Dictate notes, questions and editing instructions through speech-to-text commands, which require SoX for audio recording and processing.
  • Image generation: Generate images directly from Neovim without switching to a browser.

The plugin is free and open source under the MIT license, and runs in Neovim on Linux, BSD and macOS. It connects to Ollama for local, offline model use and to LM Studio or other OpenAI-compatible endpoints. Cloud connections include OpenAI, Anthropic Claude, Google Gemini, Perplexity and GitHub Copilot. Local Ollama requests stay on your machine; cloud requests send prompts and selected context to the chosen provider and need internet access plus the provider's credentials or account.

Similar to gp.nvim