Skip to content

Commit

Permalink
feat(plugins): add copilot chat
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedAbdulrahman committed Mar 16, 2024
1 parent 6651813 commit ff4e811
Showing 1 changed file with 45 additions and 4 deletions.
49 changes: 45 additions & 4 deletions nvim/lua/core/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -894,15 +894,56 @@ return {
cond = NvimConfig.plugins.ai.copilot.enabled,
cmd = "Copilot",
build = ":Copilot auth",
event = "InsertEnter",
lazy = false,
config = function()
require('plugins.copilot')
end,
},
{
'madox2/vim-ai',
cond = NvimConfig.plugins.ai.vim_ai.enabled,
lazy = false,
"CopilotC-Nvim/CopilotChat.nvim",
event = "VeryLazy",
opts = {
show_help = "no",
prompts = {
Explain = "Explain how it works.",
Review = "Review the following code and provide concise suggestions.",
Tests = "Briefly explain how the selected code works, then generate unit tests.",
Refactor = "Refactor the code to improve clarity and readability.",
},
},
build = function()
vim.defer_fn(function()
vim.cmd("UpdateRemotePlugins")
vim.notify("CopilotChat - Updated remote plugins. Please restart Neovim.")
end, 3000)
end,
keys = {
{ "<leader>ccb", ":CopilotChatBuffer<cr>", desc = "CopilotChat - Buffer" },
{ "<leader>cce", "<cmd>CopilotChatExplain<cr>", desc = "CopilotChat - Explain code" },
{ "<leader>cct", "<cmd>CopilotChatTests<cr>", desc = "CopilotChat - Generate tests" },
{
"<leader>ccT",
"<cmd>CopilotChatVsplitToggle<cr>",
desc = "CopilotChat - Toggle Vsplit", -- Toggle vertical split
},
{
"<leader>ccv",
":CopilotChatVisual",
mode = "x",
desc = "CopilotChat - Open in vertical split",
},
{
"<leader>ccc",
":CopilotChatInPlace<cr>",
mode = { "n", "x" },
desc = "CopilotChat - Run in-place code",
},
{
"<leader>ccf",
"<cmd>CopilotChatFixDiagnostic<cr>", -- Get a fix for the diagnostic message under the cursor.
desc = "CopilotChat - Fix diagnostic",
},
}
},
{
'jackMort/ChatGPT.nvim',
Expand Down

0 comments on commit ff4e811

Please sign in to comment.