GitHub Copilot for Vim and Neovim

repository·release·Indexed 11 days ago

https://github.com/github/copilot.vim

An AI pair programming plugin for Vim (9.0.0185+) and Neovim that provides inline coding suggestions based on natural language prompts, comments, and method names.

Tokens
456
Snippets
2
Records
3
Agent score
45%

What's inside GitHub Copilot

  1. Install GitHub Copilot for Vim and Neovim

    release

    To install copilot.vim, ensure you meet the following prerequisites:

    1. Editor: Install [Neovim] or the latest patch of [Vim] (9.0.0185 or newer).
    2. Runtime: Install [Node.js]. If using a package manager, ensure npm is also installed (e.g., apt install nodejs npm on Debian/Ubuntu).
    3. Plugin Manager: Use vim-plug, lazy.nvim, or any other plugin manager to install github/copilot.vim.

    Alternatively, you can install manually by cloning the repository into your pack directory:

    Linux/macOS

    • Vim: git clone --depth=1 https://github.com/github/copilot.vim.git ~/.vim/pack/github/start/copilot.vim
    • Neovim: git clone --depth=1 https://github.com/github/copilot.vim.git ~/.config/nvim/pack/github/start/copilot.vim

    Windows (PowerShell)

    • Vim: git clone --depth=1 https://github.com/github/copilot.vim.git $HOME/vimfiles/pack/github/start/copilot.vim
    • Neovim: git clone --depth=1 https://github.com/github/copilot.vim.git $HOME/AppData/Local/nvim/pack/github/start/copilot.vim
    git clone --depth=1 https://github.com/github/copilot.vim.git ~/.config/nvim/pack/github/start/copilot.vim
  2. Configure GitHub Copilot via :Copilot setup

    release

    After installing the plugin, you must authenticate your GitHub Copilot subscription. Start your Vim or Neovim instance and run the following command:

    :Copilot setup

    Follow the on-screen instructions to complete the setup process.

    :Copilot setup
  3. Use GitHub Copilot suggestions

    release

    Once configured, GitHub Copilot provides AI-powered coding suggestions based on natural language prompts, comments, and method names.

    • Viewing suggestions: Suggestions are displayed inline within your editor.
    • Accepting suggestions: Press the <Tab> key to accept an inline suggestion.

    For detailed information on all available commands and configurations, run :help copilot within your editor.