diff --git a/after/plugin/llm.lua b/after/plugin/llm.lua new file mode 100644 index 0000000..a582154 --- /dev/null +++ b/after/plugin/llm.lua @@ -0,0 +1,30 @@ +require("codecompanion").setup({ + adapters = { + llama3_2 = function() + return require("codecompanion.adapters").extend("ollama", { + name = "llama3_2", -- Give this adapter a different name to differentiate it from the default ollama adapter + schema = { + model = { + default = "llama3.2:latest", + }, + }, + }) + end, + }, + strategies = { + chat = { + adapter= "llama3_2", + }, + inline = { + adapter="llama3_2", + } + } +}) + +vim.api.nvim_set_keymap("v", "ce", "", { + callback = function() + require("codecompanion").prompt("explain") + end, + noremap = true, + silent = true, +}) diff --git a/lua/pippy/lazy.lua b/lua/pippy/lazy.lua index fac0216..83bec97 100644 --- a/lua/pippy/lazy.lua +++ b/lua/pippy/lazy.lua @@ -27,6 +27,7 @@ require("lazy").setup({ }, { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, { "olimorris/onedarkpro.nvim", priority = 1000}, -- Ensure it loads first + {"olimorris/codecompanion.nvim"}, { "zootedb0t/citruszest.nvim", lazy = false, priority = 1000, }, {'norcalli/nvim-colorizer.lua'}, {