From ba187eae9279a49849213d8a3d29eddeb9142613 Mon Sep 17 00:00:00 2001 From: Daniel Weber Date: Sun, 5 Jan 2025 21:59:05 -0500 Subject: [PATCH] Lots of work still needed to be able to use the llm effectively. But its a start --- after/plugin/llm.lua | 30 ++++++++++++++++++++++++++++++ lua/pippy/lazy.lua | 1 + 2 files changed, 31 insertions(+) create mode 100644 after/plugin/llm.lua 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'}, {