Adding ollama config

This commit is contained in:
Ian Roddis
2025-02-04 16:10:13 -04:00
parent b40bc1865f
commit 44cbbbfad8
+21 -4
View File
@@ -358,7 +358,8 @@ require('lazy').setup({
vim.opt.ai = true -- Autoindent vim.opt.ai = true -- Autoindent
vim.opt.updatetime = 50 vim.opt.updatetime = 50
vim.opt.mouse = '' vim.opt.mouse = ''
vim.opt.ttimeoutlen = 150 -- Leader timeout (default 50) vim.opt.ttimeoutlen = 1000
-- vim.opt.ttimeoutlen = 0 -- Leader timeout (default 50)
-- Whitespace -- Whitespace
vim.opt.tabstop = 2 vim.opt.tabstop = 2
@@ -920,14 +921,30 @@ autocmd("BufWritePost", {
require("codecompanion").setup({ require("codecompanion").setup({
strategies = { strategies = {
chat = { chat = {
adapter = "anthropic", adapter = "ollama",
}, },
inline = { inline = {
adapter = "anthropic", adapter = "ollama",
}, },
}, },
adapters = {
ollama = function()
return require("codecompanion.adapters").extend("ollama", {
env = {
url = "http://192.168.203.8:11434"
-- api_key = "OLLAMA_API_KEY",
},
headers = {
["Content-Type"] = "application/json"
-- ["Authorization"] = "Bearer ${api_key}",
},
parameters = {
sync = true,
},
})
end,
},
}) })
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et