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 is available to GitHub customers with a personal account on GitHub.com. Managed user accounts cannot use GitHub Copilot.

GitHub Copilot is free to use for verified students, teachers, and maintainers of popular open source projects. If you are not a student, teacher, or maintainer of a popular open source project, you can try GitHub Copilot for free with a one-time 60 day trial. After the free trial, you will need a paid subscription for continued use. 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".

If you use a 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