From cc98f9145be8364903a06adf6f420d61c7193150 Mon Sep 17 00:00:00 2001 From: lowell Date: Sun, 2 Mar 2025 11:02:51 -0500 Subject: [PATCH] changed leader leader to toggling the chat buffer --- lua/core/keymaps.lua | 2 +- lua/plugins/codecompanion.lua | 16 ++++++++++++++-- lua/plugins/telescope.lua | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 9da1749..7959936 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -9,7 +9,7 @@ vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) local opts = { noremap = true, silent = true } -- This is for CodeCompanion Plugin. I will move this later -vim.keymap.set('n', 'mt', ':CodeCompanionChat Toggle', opts) +vim.keymap.set('n', '', ':CodeCompanionChat Toggle', opts) -- save file vim.keymap.set('n', '', ' w ', opts) diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index e99b07a..cdf2799 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -57,6 +57,18 @@ return { }, }) end, + openai = function() + return require('codecompanion.adapters').extend('openai', { + env = { + api_key = os.getenv 'OPEN_API_KEY', + }, + schema = { + model = { + default = 'gpt-3.5-turbo', + }, + }, + }) + end, deepseekr1 = function() return require('codecompanion.adapters').extend('ollama', { name = 'deepseekr1', -- Give this adapter a different name to differentiate it from the default ollama adapter @@ -76,10 +88,10 @@ return { }, strategies = { chat = { - adapter = 'codellama', + adapter = 'llama3', }, inline = { - adapter = 'codellama', + adapter = 'llama3', }, }, }, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index ec39068..7ad25ae 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -90,7 +90,7 @@ return { vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'b', builtin.buffers, { desc = '[ ] Find existing buffers' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function()