explaingit

copilotc-nvim/copilotchat.nvim

Analysis updated 2026-05-18

3,635Audience · developerComplexity · 2/5Setup · moderate

TLDR

A Neovim plugin that adds an AI chat window powered by GitHub Copilot Chat, letting you reference code and get diffable AI edits inside the editor.

Mindmap

mindmap
  root((CopilotChat.nvim))
    What it does
      AI chat inside Neovim
      Diffable code edits
      Privacy first design
    Tech stack
      Neovim
      Lua
      GitHub Copilot Chat
    Use cases
      Ask AI about your code
      Review proposed diffs
      Switch between AI models
    Audience
      Neovim users
      Developers
      Vibe coders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Chat with an AI about your codebase directly inside Neovim without switching to a browser.

USE CASE 2

Reference specific files or git history in a prompt using the # and @ shortcuts.

USE CASE 3

Review AI-proposed code changes as diffs before accepting or discarding them.

USE CASE 4

Switch between AI models like GPT-4o, Claude, and Gemini within the same chat session.

What is it built with?

NeovimLuaGitHub Copilot

How does it compare?

copilotc-nvim/copilotchat.nvimarl/statsvizdotnet/maui-samples
Stars3,6353,6353,635
LanguageGoC#
Setup difficultymoderateeasymoderate
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Neovim 0.10+, curl, and an active GitHub Copilot subscription with Chat enabled.

In plain English

CopilotChat.nvim is a plugin for Neovim, a highly configurable text editor used by many developers, that adds an AI chat window directly inside the editor. It connects to GitHub Copilot Chat, which gives access to several AI models including GPT-4o, multiple Claude versions, Gemini, and others. You can also point it at locally running models through tools like Ollama, or use Mistral's cloud service. The chat works alongside your code rather than in a separate browser tab. You reference files or code snippets using a # symbol followed by the resource name, give the AI access to tools (like searching the codebase or reading git history) with an @ symbol, and switch between AI models with a $ symbol. Typing Tab after any of these shortcuts shows a list of options to pick from. The AI can propose code changes, and those proposed changes appear as readable diffs inside Neovim so you can accept or discard them without leaving the editor. A notable design choice is what the README calls privacy-first: the plugin only sends to the AI what you explicitly ask it to. There is no background scanning or automatic data collection. You approve any tool call the AI wants to make before it runs, though you can configure trusted tools to run automatically if you prefer. Setting it up requires Neovim version 0.10 or newer, curl, and an active GitHub Copilot subscription with Chat features enabled in your GitHub account settings. You install the plugin through whichever Neovim plugin manager you already use, such as lazy.nvim or vim-plug, and call a short setup function to initialize it. Optional extras like ripgrep improve search speed and a tiktoken library gives more accurate counts of how much text is being sent to the AI. The plugin exposes a Lua scripting interface for automation and supports custom functions and third-party integrations from the community. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to install CopilotChat.nvim with lazy.nvim and run the setup function.
Prompt 2
Explain how the #, @, and $ shortcuts work in CopilotChat.nvim for referencing files, tools, and models.
Prompt 3
How does CopilotChat.nvim's privacy-first design decide what gets sent to the AI?
Prompt 4
Walk me through reviewing and accepting an AI-proposed code diff inside Neovim using this plugin.

Frequently asked questions

What is copilotchat.nvim?

A Neovim plugin that adds an AI chat window powered by GitHub Copilot Chat, letting you reference code and get diffable AI edits inside the editor.

How hard is copilotchat.nvim to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is copilotchat.nvim for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.