feat adding copilot
This commit is contained in:
@@ -9,7 +9,7 @@ return {
|
|||||||
vendors = {
|
vendors = {
|
||||||
cargdev = {
|
cargdev = {
|
||||||
name = "cargdev", -- Optional
|
name = "cargdev", -- Optional
|
||||||
endpoint = "https://api-ai.cargdev.io/api/generate",
|
endpoint = "https://api-ai.cargdev.io/api/generate", -- API endpoint
|
||||||
api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below
|
api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below
|
||||||
model = "codellama:7b",
|
model = "codellama:7b",
|
||||||
__inherited_from = "ollama", -- ensures compatibility
|
__inherited_from = "ollama", -- ensures compatibility
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
-- Main Copilot plugin
|
||||||
"zbirenbaum/copilot.lua",
|
"zbirenbaum/copilot.lua",
|
||||||
lazy = false, -- Load at startup
|
lazy = false, -- Load at startup
|
||||||
enabled = true,
|
enabled = true,
|
||||||
@@ -38,4 +40,42 @@ return {
|
|||||||
copilot_node_command = "node", -- Ensure your system's Node.js is v20+
|
copilot_node_command = "node", -- Ensure your system's Node.js is v20+
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- Copilot Chat plugin
|
||||||
|
"CopilotC-Nvim/CopilotChat.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "github/copilot.vim" }, -- Or zbirenbaum/copilot.lua
|
||||||
|
{ "nvim-lua/plenary.nvim", branch = "master" }, -- For curl, log and async functions
|
||||||
|
},
|
||||||
|
build = "make tiktoken", -- Only on MacOS or Linux
|
||||||
|
opts = {
|
||||||
|
layout = {
|
||||||
|
position = "right", -- Position of the chat window
|
||||||
|
ratio = 0.5,
|
||||||
|
},
|
||||||
|
floating = {
|
||||||
|
enabled = true,
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
|
prompts = {
|
||||||
|
Rename = {
|
||||||
|
prompt = "Please rename the variable correctly in given selection based on context",
|
||||||
|
selection = function(source)
|
||||||
|
local select = require("CopilotChat.select")
|
||||||
|
return select.visual(source)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>zn", ":CopilotChatRename<CR>", mode = "v", desc = "Rename the variable" },
|
||||||
|
{ "<leader>zc", ":CopilotChat<CR>", mode = "n", desc = "Chat with Copilot" },
|
||||||
|
{ "<leader>ze", ":CopilotChatExplain<CR>", mode = "v", desc = "Explain Code" },
|
||||||
|
{ "<leader>zr", ":CopilotChatReview<CR>", mode = "v", desc = "Review Code" },
|
||||||
|
{ "<leader>zf", ":CopilotChatFix<CR>", mode = "v", desc = "Fix Code Issues" },
|
||||||
|
{ "<leader>zo", ":CopilotChatOptimize<CR>", mode = "v", desc = "Optimize Code" },
|
||||||
|
{ "<leader>zd", ":CopilotChatDocs<CR>", mode = "v", desc = "Generate Docs" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user