ooooooh ai here we come!

This commit is contained in:
Solomon Laing 2025-07-17 21:24:52 +09:30
parent 74641de040
commit e432b71f4e
4 changed files with 54 additions and 1 deletions

1
.config/nvim/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
lazy-lock.json

View File

@ -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" }

View 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,
},
},
},
}

View File

@ -68,6 +68,7 @@ return {
"vim",
"javascript",
"regex",
"markdown",
"markdown_inline",
"typescript",
"html",