Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 2 · SETUP

How to Set Up GitHub Copilot in Neovim (Step by Step)

Neovim can use GitHub Copilot for inline code completion through the official github/copilot.vim plugin. It is not a full Copilot Chat / Agent IDE like VS Code. That limit is honest and important.

In short: need Neovim 0.6+ (or Vim 9.0.0185+) and Node.js 18+, install copilot.vim, run :Copilot setup, then :Copilot enable. You get ghost-text completions. For chat or multi-file agents, use VS Code, JetBrains, or a CLI agent in a split terminal.

Why (and when) Copilot in Neovim

WHY

Many developers edit in Neovim for speed. Copilot completions keep your hands on the keyboard. If you need agent mode that edits many files and runs tests for you, Neovim’s official Copilot plugin is the wrong tool — use another client beside it.

What you get vs what you do not

WHAT
  • Completions: Inline suggestions as you type (the main feature).
  • Not included (official plugin): Copilot Chat panel and Agent mode like VS Code — GitHub documents Neovim as completion-focused.
  • Node.js 18+: Required by the plugin’s agent process.
  • GitHub Copilot plan: Free or paid plan on your GitHub account.

How setup flows

1 · Check Neovim + Node nvim -v · node -v 2 · Install copilot.vim packpath or plugin manager 3 · :Copilot setup browser GitHub auth 4 · :Copilot enable turn completions on 5 · Map keys (optional) accept / next / dismiss

Install steps

HOW
  1. Check versions: nvim -v (need 0.6+) and node -v (need 18+).
  2. Install with Neovim’s built-in packs (GitHub’s documented path), macOS/Linux:
git clone https://github.com/github/copilot.vim \
  ~/.config/nvim/pack/github/start/copilot.vim
HOW
  1. Or install github/copilot.vim with your plugin manager (lazy.nvim, packer, vim-plug) — follow that manager’s syntax.
  2. Open Neovim and run: :Copilot setup. Complete the GitHub device/browser login.
  3. Enable: :Copilot enable (or enable from your config so it starts on launch).
  4. Open a code file, type a comment or function header, wait for ghost text, accept with the mapped key (often Tab unless you remapped it).

Settings

  1. Status: :Copilot status shows if you are signed in.
  2. Disable for a buffer: :Copilot disable when suggestions distract you.
  3. Filetypes: you can limit which file types get suggestions in your Neovim config (see plugin help :help copilot).
  4. Keymaps: defaults may not match VS Code. Map accept/next yourself if Tab is already used for completion menus.
Optional keymap note (Lua)
-- Optional: map accept/next after :Copilot enable
-- vim.keymap.set('i', '<C-J>', 'copilot#Accept("\\<CR>")', { expr = true, replace_keycodes = false })
-- vim.g.copilot_no_tab_map = true

Configuration honesty

NeedIn Neovim Copilot?Better option
Ghost-text completionsYes—
Side chat explaining an errorNot in official pluginVS Code / JetBrains Copilot Chat, or paste into a CLI agent
Multi-file agent + testsNot in official pluginClaude Code CLI, Codex CLI, or Copilot Agent in a GUI IDE
Project instruction filesLimited / different UXKeep a short README; use CLI agents that read AGENTS.md / CLAUDE.md

First task (5 minutes)

TYPE THIS COMMENT THEN WAIT

-- return true if n is even

  1. In a Lua or Python buffer, type a clear comment or stub signature.
  2. Accept a suggestion only if you understand it.
  3. Run your own quick check (lua, pytest, etc.).
  4. For a failing stack trace, open a split terminal and use a CLI coding agent — do not expect Copilot Chat inside Neovim.
Rule: third-party Neovim “Copilot Chat” plugins exist but are not the same as GitHub’s first-party VS Code experience. This lesson covers the official completion plugin only.
  • Do not commit GitHub tokens.
  • Company machines may block Copilot — use only if policy allows.

Quick quiz

1. What does official Copilot in Neovim mainly provide?

Inline code completions.

2. Minimum Node version?

Node.js 18 or above.

3. Command to authenticate?

:Copilot setup.

4. Need agent mode that edits many files?

Use a GUI Copilot Agent or a terminal coding CLI — not the Neovim completion plugin alone.

Save tokens and money

SMART AI USE

Completions are cheap compared with long chat agents. Keep comments clear so suggestions stay short. Dismiss junk with Esc.

Save these cards

INTERVIEW CARDAI Coding

Copilot in Neovim?

Official copilot.vim: completions.
Chat/Agent: use another Copilot client or a CLI.
Ravindra Bagale · ravindrabagale.com/ai-coding
COMPARISON CARDAI Coding

Neovim vs VS Code Copilot

Neovim: completion-first.
VS Code: completions + chat + agent.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

Neovim Copilot in 4

Node 18+ · install copilot.vim.
:Copilot setup → enable.
Map accept keys.
Know the chat/agent limit.
Ravindra Bagale · ravindrabagale.com/ai-coding