configure copilot chat
This commit is contained in:
parent
16494e5f05
commit
1fa821d61c
|
@ -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 = {
|
||||||
|
{ "<leader>cce", "<cmd>CopilotChatExplain<cr>", desc = "CopilotChat - Explain code" },
|
||||||
|
{ "<leader>cct", "<cmd>CopilotChatTests<cr>", desc = "CopilotChat - Generate tests" },
|
||||||
|
{
|
||||||
|
"<leader>ccc",
|
||||||
|
":CopilotChatToggle<CR>",
|
||||||
|
mode = { "n", "x" },
|
||||||
|
desc = "CopilotChat",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ccf",
|
||||||
|
"<cmd>CopilotChatFixDiagnostic<cr>", -- Get a fix for the diagnostic message under the cursor.
|
||||||
|
desc = "CopilotChat Fix Diagnostic",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
|
@ -20,15 +20,5 @@ return {
|
||||||
end,
|
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' },
|
{ 'AndreM222/copilot-lualine' },
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue