Update code companion to use copilot claude sonnet 3.7, add support for
gemini and openai with api keys. Additionally add code companion. Finally, add VectorCode with Code Companion which caches and gives context of private local projects to AI for better insight. completion in blink.
This commit is contained in:
parent
9b181bdf2c
commit
0db6d4183b
3 changed files with 93 additions and 14 deletions
|
|
@ -16,7 +16,10 @@ return {
|
|||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
default = { "lsp", "path", "snippets", "buffer", },
|
||||
per_filetype = {
|
||||
codecompanion = { "codecompanion", },
|
||||
},
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
|
|
|
|||
|
|
@ -1,25 +1,98 @@
|
|||
return {
|
||||
"olimorris/codecompanion.nvim",
|
||||
"olimorris/codecompanion.nvim", -- The KING of AI programming
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
{
|
||||
"Davidyz/VectorCode",
|
||||
version = "*",
|
||||
build = "pipx upgrade vectorcode",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
"echasnovski/mini.diff",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
copilot = function()
|
||||
return require("codecompanion.adapters").extend("copilot", {
|
||||
schema = {
|
||||
model = {
|
||||
default = "claude-3.7-sonnet",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
gemini = function()
|
||||
return require("codecompanion.adapters").extend("gemini", {
|
||||
schema = {
|
||||
model = {
|
||||
default = "gemini-2.5-pro-exp-03-25",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
openai = function()
|
||||
return require("codecompanion.adapters").extend("openai", {
|
||||
opts = {
|
||||
stream = true,
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = function()
|
||||
return "gpt-4o"
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = "copilot",
|
||||
roles = {
|
||||
user = "Martin",
|
||||
},
|
||||
keymaps = {
|
||||
send = {
|
||||
modes = {
|
||||
i = { "<C-CR>", "<C-s>" },
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
modes = {
|
||||
i = "<C-x>",
|
||||
},
|
||||
},
|
||||
},
|
||||
slash_commands = {
|
||||
["buffer"] = {
|
||||
opts = {
|
||||
keymaps = {
|
||||
modes = {
|
||||
i = "<C-b>",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
["help"] = {
|
||||
opts = {
|
||||
max_lines = 1000,
|
||||
},
|
||||
},
|
||||
},
|
||||
tools = {
|
||||
vectorcode = {
|
||||
description = "Run VectorCode to retrieve the project context.",
|
||||
callback = function()
|
||||
return require("vectorcode.integrations").codecompanion.chat.make_tool()
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
inline = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
agent = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
},
|
||||
adapters = {
|
||||
copilot = function() return require("codecompanion.adapters").extend("copilot", {}) end,
|
||||
inline = { adapter = "copilot" },
|
||||
},
|
||||
display = {
|
||||
action_palette = {
|
||||
provider = "default",
|
||||
},
|
||||
diff = {
|
||||
provider = "mini_diff",
|
||||
},
|
||||
|
|
@ -29,6 +102,7 @@ return {
|
|||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<C-a>", "<cmd>CodeCompanionActions<cr>" },
|
||||
{ "<Leader>ci", "<cmd>CodeCompanion<cr>" },
|
||||
{ "<Leader>cc", "<cmd>CodeCompanionChat toggle<cr>" },
|
||||
{ "<Leader>ce", "<cmd>CodeCompanion /explain<cr>", mode = "v" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue