Document how to include files in the context without manual work
I see the context functionality has again changed -- specifically #buffers was removed, and the suggestion it appears is to use one of the other context control mechanisms.
To me there seems to be a few issues with that:
#buffer's options (whatever they're called, the thing after#buffer:<here>are not documented, and the only example shown is for:active-- I presume maybe it takes a buffer ID? But yeah some detail on how that should be used would certainly be helpful.- manually typing out which files to include seems significantly slower than previous workflows. E.g. with
#buffersI could simply open the files I wanted to include and then simply have those included in the context. Now that's impossible without typing out long paths using#file-- or without me writing automation for that, which of course isn't difficult (e.g. using a picker to pick out a bunch of files and write out#filelines for each one) but it still seems inefficient and like extra work, so just want to check I'm not missing something obvious.
(n.b. I can see that from an accidental inclusion standpoint having an option that does "send all buffers" perhaps seems dangerous -- and that worries me as well, but thusfar I've just been very sure to exit neovim if I ever open up a buffer I'd be mortified if were sent to an LLM provider.)
Perhaps the thing I'm missing is an assumption that one is using the CopilotChat.nvim tab completion support, which I'm not (due to various issues with it which I don't recall ultimately having to do with not wanting a different completion setup in chat windows than anywhere else in neovim) -- but is that the reason #file is considered a replacement perhaps?
Thanks for any info or corrections!
You can add all buffers at once with #buffer:listed i basically just mergedthe 2 together. but you can always just press <tab> after #buffer: or #file: you dont need to manually actually type stuff.
I agree that all options should maybe be documented better, currently you are expected to look at schema in the autocomplete description and use the tab complete mostly which is not ideal
but you can always just press after #buffer: or #file: you dont need to manually actually type stuff.
Can press what? Tab? That doesn't seem to work.
Fwiw, I tried to add the following to easily select files for CopilotChat to look at, but this does not work
-- setup a file picker for copilot chat
vim.keymap.set('n', '<leader>cf', function()
require('fzf-lua').files({
actions = {
['default'] = function(selected)
vim.api.nvim_put({ selected[1] }, 'c', true, true)
end,
}
})
end, { desc = 'FZF file picker for CopilotChat' })
The file picker finds files, I select them and a path is inserted into the chat, but doing that (even after typing file:/), Copilot is not able to find the file.
but you can always just press after #buffer: or #file: you dont need to manually actually type stuff.
Can press what? Tab? That doesn't seem to work.
Fwiw, I tried to add the following to easily select files for CopilotChat to look at, but this does not work
-- setup a file picker for copilot chat vim.keymap.set('n', '<leader>cf', function() require('fzf-lua').files({ actions = { ['default'] = function(selected) vim.api.nvim_put({ selected[1] }, 'c', true, true) end, } }) end, { desc = 'FZF file picker for CopilotChat' })The file picker finds files, I select them and a path is inserted into the chat, but doing that (even after typing file:/), Copilot is not able to find the file.
Yes tab. See https://github.com/CopilotC-Nvim/CopilotChat.nvim?tab=readme-ov-file#chat-key-mappings , some other plugin might be conflicting with the mapping so you might want to remap one