Skip to main content

Getting started with GitHub Copilot in Neovim

Learn how to install GitHub Copilot in Neovim, and start seeing suggestions as you write comments and code.

GitHub Copilot can be managed through personal accounts with GitHub Copilot for Individuals or through organization or enterprise accounts with GitHub Copilot for Business.

GitHub Copilot is free to use for verified students, teachers, and maintainers of popular open source projects. For more information, see "About billing for GitHub Copilot."

Try GitHub Copilot

About GitHub Copilot and Neovim

GitHub Copilot provides autocomplete-style suggestions from an AI pair programmer as you code. For more information, see "About GitHub Copilot for Individuals".

If you use Neovim, you can view and incorporate suggestions from GitHub Copilot directly within the editor.

Prerequisites

Installing the Neovim extension

  1. GitHub recommends that you install the GitHub Copilot plugin with Neovim's built-in plugin manager. Alternatively, you can use a plugin manager of your choice to install github/copilot.vim.

    • To install GitHub Copilot with Neovim's built-in plugin manager, enter the following command in Terminal.

      git clone https://github.com/github/copilot.vim \
         ~/.config/nvim/pack/github/start/copilot.vim
      
  2. To configure GitHub Copilot, open Neovim and enter the following command.

    :Copilot setup
    
  3. Enable GitHub Copilot in your Neovim configuration, or with the Neovim command.

    :Copilot enable
    
  1. GitHub recommends that you install the GitHub Copilot plugin with Neovim's built-in plugin manager. Alternatively, you can use a plugin manager of your choice to install github/copilot.vim.

    • To install GitHub Copilot with Neovim's built-in plugin manager, enter the following command in Git Bash.

        git clone https://github.com/github/copilot.vim.git \
         $HOME/AppData/Local/nvim/pack/github/start/copilot.vim
      
  2. To configure GitHub Copilot, open Neovim and enter the following command.

    :Copilot setup
    
  3. Enable GitHub Copilot in your Neovim configuration, or with the Neovim command.

    :Copilot enable
    
  1. GitHub recommends that you install the GitHub Copilot plugin with Neovim's built-in plugin manager. Alternatively, you can use a plugin manager of your choice to install github/copilot.vim.

    • To install GitHub Copilot with Neovim's built-in plugin manager, enter the following command:

      git clone https://github.com/github/copilot.vim \
         ~/.config/nvim/pack/github/start/copilot.vim
      
  2. To configure GitHub Copilot, open Neovim and enter the following command.

    :Copilot setup
    
  3. Enable GitHub Copilot in your Neovim configuration, or with the Neovim command.

    :Copilot enable
    

Learning to use GitHub Copilot in Neovim

For guidance on using GitHub Copilot in Neovim, you can view the plugin documentation. To see the documentation, open Neovim and run the following command.

:help copilot

Further reading