Skip to content

josiahdenton/copilot-chat-context.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

copilot-chat-context.nvim

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.

Install

    {
        "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
    },

Panel

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
image

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

Usage

generate generate code inline
ccc_generate_example.mov
explain explain selected code / context
ccc_explain_example.mov
ask ask a question
ccc_ask_example.mov

About

a fine grained approach to managing copilot chat context

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages