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
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
- 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
Install steps
- Check versions:
nvim -v(need 0.6+) andnode -v(need 18+). - 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
- Or install
github/copilot.vimwith your plugin manager (lazy.nvim, packer, vim-plug) — follow that manager’s syntax. - Open Neovim and run:
:Copilot setup. Complete the GitHub device/browser login. - Enable:
:Copilot enable(or enable from your config so it starts on launch). - 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
- Status:
:Copilot statusshows if you are signed in. - Disable for a buffer:
:Copilot disablewhen suggestions distract you. - Filetypes: you can limit which file types get suggestions in your Neovim config (see plugin help
:help copilot). - Keymaps: defaults may not match VS Code. Map accept/next yourself if Tab is already used for completion menus.
-- 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 = trueConfiguration honesty
| Need | In Neovim Copilot? | Better option |
|---|---|---|
| Ghost-text completions | Yes | — |
| Side chat explaining an error | Not in official plugin | VS Code / JetBrains Copilot Chat, or paste into a CLI agent |
| Multi-file agent + tests | Not in official plugin | Claude Code CLI, Codex CLI, or Copilot Agent in a GUI IDE |
| Project instruction files | Limited / different UX | Keep a short README; use CLI agents that read AGENTS.md / CLAUDE.md |
First task (5 minutes)
-- return true if n is even
- In a Lua or Python buffer, type a clear comment or stub signature.
- Accept a suggestion only if you understand it.
- Run your own quick check (
lua,pytest, etc.). - For a failing stack trace, open a split terminal and use a CLI coding agent — do not expect Copilot Chat inside Neovim.
- 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
Completions are cheap compared with long chat agents. Keep comments clear so suggestions stay short. Dismiss junk with Esc.