ooooooh ai here we come!
This commit is contained in:
parent
74641de040
commit
e432b71f4e
1
.config/nvim/.gitignore
vendored
Normal file
1
.config/nvim/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
lazy-lock.json
|
||||
@ -41,7 +41,8 @@ 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', 'codecompanion' },
|
||||
-- default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
|
||||
50
.config/nvim/lua/lazyvim/plugins/codecompanion.lua
Normal file
50
.config/nvim/lua/lazyvim/plugins/codecompanion.lua
Normal file
@ -0,0 +1,50 @@
|
||||
return {
|
||||
{
|
||||
"olimorris/codecompanion.nvim",
|
||||
enabled = true,
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim", branch = "master" },
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"ravitemer/mcphub.nvim",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>C", "<cmd>CodeCompanionChat<cr>", desc = "Open CodeCompanion Chat" }
|
||||
},
|
||||
opts = {
|
||||
strategies = {
|
||||
chat = { adapter = "openai" },
|
||||
inline = { adapter = "openai" },
|
||||
},
|
||||
extensions = {
|
||||
mcphub = {
|
||||
callback = "mcphub.extensions.codecompanion",
|
||||
opts = {
|
||||
make_vars = true,
|
||||
make_slash_commands = true,
|
||||
show_result_in_chat = true
|
||||
}
|
||||
}
|
||||
},
|
||||
opts = {
|
||||
log_level = "DEBUG",
|
||||
},
|
||||
adapters = {
|
||||
openai = function()
|
||||
return require("codecompanion.adapters").extend("openai", {
|
||||
env = {
|
||||
api_key = "cmd:cat $HOME/.config/openai/KEY",
|
||||
},
|
||||
})
|
||||
end,
|
||||
anthropic = function()
|
||||
return require("codecompanion.adapters").extend("anthropic", {
|
||||
env = {
|
||||
api_key = "cmd:cat $HOME/.config/anthropic/KEY",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -68,6 +68,7 @@ return {
|
||||
"vim",
|
||||
"javascript",
|
||||
"regex",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"typescript",
|
||||
"html",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user