Skip to content

Commit

Permalink
feat(plugins): setup codeium and copilot AI integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
ecosse3 committed Aug 23, 2024
1 parent d898ef8 commit ab63e37
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 4 deletions.
13 changes: 13 additions & 0 deletions lua/plugins/ai/codeium.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
{
"jcdickinson/codeium.nvim",
cond = EcoVim.plugins.ai.codeium.enabled,
event = "InsertEnter",
cmd = "Codeium",
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
},
config = true,
},
}
48 changes: 48 additions & 0 deletions lua/plugins/ai/copilot-chat.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
return {
{
"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",
},
}
},
}
11 changes: 11 additions & 0 deletions lua/plugins/ai/copilot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return {
{
"zbirenbaum/copilot.lua",
cond = EcoVim.plugins.ai.copilot.enabled,
lazy = false,
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
}
},
}
4 changes: 0 additions & 4 deletions lua/plugins/copilot.lua

This file was deleted.

0 comments on commit ab63e37

Please sign in to comment.