Skip to content
 
 

Repository files navigation

ChatGPT for Vim and Neovim

An experimental Vim/Neovim inline-completion plugin backed by your ChatGPT subscription through the local Codex CLI. It does not use GitHub Copilot or an OpenAI API key.

Getting started

  1. Install Neovim or the latest patch of Vim (9.0.0185 or newer).

  2. Install Node.js and the Codex CLI globally:

    npm install -g @openai/codex
    

    Codex must be available as codex in your PATH. You do not need to sign in separately: after installing this plugin, :Copilot setup starts the ChatGPT device-code login flow inside Vim/Neovim.

  3. Install nexxai/chatgpt.vim using vim-plug, lazy.nvim, or any other plugin manager. Or to install manually, run one of the following commands:

    • Vim, Linux/macOS:

       git clone --depth=1 https://github.com/nexxai/chatgpt.vim.git \
         ~/.vim/pack/nexxai/start/chatgpt.vim
      
    • Neovim, Linux/macOS:

       git clone --depth=1 https://github.com/nexxai/chatgpt.vim.git \
         ~/.config/nvim/pack/nexxai/start/chatgpt.vim
      
    • Vim, Windows (PowerShell command):

       git clone --depth=1 https://github.com/nexxai/chatgpt.vim.git `
         $HOME/vimfiles/pack/nexxai/start/chatgpt.vim
      
    • Neovim, Windows (PowerShell command):

       git clone --depth=1 https://github.com/nexxai/chatgpt.vim.git `
         $HOME/AppData/Local/nvim/pack/nexxai/start/chatgpt.vim
      
  4. Start Vim/Neovim and invoke :Copilot setup.

Suggestions are displayed inline and can be accepted by pressing the tab key. See :help copilot for more information.

Troubleshooting

Codex requests are more expensive and slower than a dedicated autocomplete service. The default 600 ms idle delay prevents a request for every keystroke.

About

Neovim plugin for GitHub Copilot

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages