CopilotC-Nvim / CopilotChat.nvim

Chat with GitHub Copilot in Neovim
https://copilotc-nvim.github.io/CopilotChat.nvim/
GNU General Public License v3.0
1.5k stars 69 forks source link

Feature request: Chat with your tab / project #294

Closed djfinnoy closed 4 months ago

djfinnoy commented 4 months ago

I'm a fan of the 'Chat with your buffer' tip in the README, but I would be happy to see an easy way to include multiple buffers in the chat context. When working on golang projects, I am often working on 3-4 files at the same time, but I can only make Copilot aware of one of them at a time through hotkeys.

It would be great if I could feed all buffers in a tab, or use telescope solution to select what files should be included in the context.

deathbeam commented 4 months ago

There is @buffers context that you can use, so something like this should work:

{
    "<leader>ccq",
    function()
      local input = vim.fn.input("Quick Chat: ")
      if input ~= "" then
        require("CopilotChat").ask(input, { context = 'buffers' })
      end
    end,
    desc = "CopilotChat - Quick chat",
  }