Skip to content

errnoh/CopilotChat.nvim

Repository files navigation

Copilot Chat for Neovim

Authentication

It will prompt you with instructions on your first start. If you already have Copilot.vim or Copilot.lua, it will work automatically.

Installation

Lazy.nvim

  1. pip install python-dotenv requests pynvim prompt-toolkit
  2. Put it in your lazy setup
require('lazy').setup({
  {
    "gptlang/CopilotChat.nvim",
    opts = {},
    build = function()
      vim.cmd("UpdateRemotePlugins")
    end,
    event = "VeryLazy",
    keys = {
      { "<leader>cce", "<cmd>CopilotChatExplain<cr>", desc = "CopilotChat - Explain code" },
      { "<leader>cct", "<cmd>CopilotChatTests<cr>", desc = "CopilotChat - Generate tests" },
    },
  },
    ...
})
  1. Run :UpdateRemotePlugins
  2. Restart neovim

Manual

  1. Put the files in the right place
$ git clone https://github.com/gptlang/CopilotChat.nvim
$ cd CopilotChat.nvim
$ cp -r --backup=nil rplugin ~/.config/nvim/
  1. Install dependencies
$ pip install -r requirements.txt
  1. Open up Neovim and run :UpdateRemotePlugins
  2. Restart Neovim

Usage

  1. Yank some code into the unnamed register (y)
  2. :CopilotChat What does this code do?

Demo

Roadmap

  • Translation to pure Lua
  • Tokenizer
  • Use vector encodings to automatically select code
  • Sub commands - See issue #5

About

Chat with GitHub Copilot in Neovim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 84.6%
  • Lua 14.8%
  • Makefile 0.6%