Improves UX of the CopilotChat.nvim
plugin.
- predefined actions
- management of contexts (markdown files, selections, urls, filetree, saved code blocks, etc)
Caution
plugin still in a "draft" state, expect some bugs! Please report if you find any.
{
"josiahdenton/copilot-chat-context.nvim",
dependencies = {
"CopilotC-Nvim/CopilotChat.nvim",
"echasnovski/mini.nvim", -- optional, uses mini.notify and will fallback to vim.notify if not available
},
config = function()
local context = require("copilot-chat-context")
context.setup()
vim.keymap.set("n", "<leader>ai", function()
context.open()
end, { desc = "open copilot context panel" })
end,
-- other configurations
},
When the panel is open, you can do any of the following...
- action: interact with copilot to create a response
- context: toggle additional info for copilot to use

The default keymaps is as follows
Action Keymaps | Description |
---|---|
,g |
generate code |
,b |
build a code block quickly |
,r |
review the current buffer and add comments |
,a |
ask a question |
,e |
explain selected code |
,k |
add knowledge |
,L |
list knowledge |
,s |
add selection |
,l |
list selections |
,z |
clear selections |
,u |
add url |
,U |
open url |
,q |
quit |
Context Keymaps | Description |
---|---|
,,A |
previously asked question and copilot's answer |
,,E |
previous explanation |
,,K |
all active knowledge files |
,,b |
all active code blocks |
,,s |
active selection |
,,g |
git staged |
,,B |
current buffer |
,,f |
file tree |
,,u |
same as using #url from CopilotChat.nvim |