diff --git a/lua/custom/plugins/copilot-chat.lua b/lua/custom/plugins/copilot-chat.lua new file mode 100644 index 00000000..4d57e35f --- /dev/null +++ b/lua/custom/plugins/copilot-chat.lua @@ -0,0 +1,45 @@ +local prompts = { + -- Code related prompts + Explain = "Please explain how the following code works.", + Review = "Please review the following code and provide suggestions for improvement.", + Tests = "Please explain how the selected code works, then generate unit tests for it.", + Refactor = "Please refactor the following code to improve its clarity and readability.", + FixCode = "Please fix the following code to make it work as intended.", + FixError = "Please explain the error in the following text and provide a solution.", + BetterNamings = "Please provide better names for the following variables and functions.", + Documentation = "Please provide documentation for the following code.", + SwaggerApiDocs = "Please provide documentation for the following API using Swagger.", + SwaggerJsDocs = "Please write JSDoc for the following API using Swagger.", + -- Text related prompts + Summarize = "Please summarize the following text.", + Spelling = "Please correct any grammar and spelling errors in the following text.", + Wording = "Please improve the grammar and wording of the following text.", + Concise = "Please rewrite the following text to make it more concise.", +} + +return { + { + "CopilotC-Nvim/CopilotChat.nvim", + branch = "canary", + event = "VeryLazy", + opts = { + show_help = "no", + prompts = prompts, + }, + keys = { + { "cce", "CopilotChatExplain", desc = "CopilotChat - Explain code" }, + { "cct", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, + { + "ccc", + ":CopilotChatToggle", + mode = { "n", "x" }, + desc = "CopilotChat", + }, + { + "ccf", + "CopilotChatFixDiagnostic", -- Get a fix for the diagnostic message under the cursor. + desc = "CopilotChat Fix Diagnostic", + }, + } + }, +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua index 5251f89c..0dd6e199 100644 --- a/lua/custom/plugins/copilot.lua +++ b/lua/custom/plugins/copilot.lua @@ -20,15 +20,5 @@ return { end, }, - { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, - { "nvim-lua/plenary.nvim", branch = "master" }, -- for curl, log and async functions - }, - build = "make tiktoken", -- Only on MacOS or Linux - opts = {}, - }, - { 'AndreM222/copilot-lualine' }, }