2025-01-05 21:59:05 -05:00
|
|
|
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,
|
2025-01-08 16:26:45 -05:00
|
|
|
phi4 = function()
|
|
|
|
return require("codecompanion.adapters").extend("ollama", {
|
|
|
|
name = "phi4", -- Give this adapter a different name to differentiate it from the default ollama adapter
|
|
|
|
schema = {
|
|
|
|
model = {
|
|
|
|
default = "phi4:latest",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end,
|
2025-01-05 21:59:05 -05:00
|
|
|
},
|
|
|
|
strategies = {
|
|
|
|
chat = {
|
2025-01-08 16:26:45 -05:00
|
|
|
adapter= "phi4",
|
2025-01-05 21:59:05 -05:00
|
|
|
},
|
|
|
|
inline = {
|
2025-01-08 16:26:45 -05:00
|
|
|
adapter="phi4",
|
2025-01-05 21:59:05 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2025-01-09 10:28:09 -05:00
|
|
|
|
|
|
|
|
2025-01-05 21:59:05 -05:00
|
|
|
vim.api.nvim_set_keymap("v", "<leader>ce", "", {
|
|
|
|
callback = function()
|
|
|
|
require("codecompanion").prompt("explain")
|
|
|
|
end,
|
|
|
|
noremap = true,
|
|
|
|
silent = true,
|
|
|
|
})
|
2025-01-09 10:28:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap("n", "<C-a>", "<cmd>CodeCompanionActions<cr>", { noremap = true, silent = true })
|
|
|
|
vim.api.nvim_set_keymap("v", "<C-a>", "<cmd>CodeCompanionActions<cr>", { noremap = true, silent = true })
|
|
|
|
vim.api.nvim_set_keymap("n", "<leader>tc", "<cmd>CodeCompanionChat Toggle<cr>", { noremap = true, silent = true })
|
|
|
|
vim.api.nvim_set_keymap("v", "<leader>tc", "<cmd>CodeCompanionChat Toggle<cr>", { noremap = true, silent = true })
|
|
|
|
vim.api.nvim_set_keymap("v", "ga", ":CodeCompanionChat Add<cr>", { noremap = true, silent = true })
|
|
|
|
|