From 98a9cab64b1558082094577748494bccee357baa Mon Sep 17 00:00:00 2001 From: lowell Date: Sun, 23 Feb 2025 21:34:00 -0500 Subject: [PATCH] added a keymap to toggel the chat buffer for code companion mt. I think I will make the letter m from normal mode the conduit into code companion keymaps since it was unoccupied --- lua/core/keymaps.lua | 3 +++ lua/plugins/codecompanion.lua | 23 +++++++++++++++++++++-- lua/plugins/colortheme.lua | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 4c182e8..9da1749 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -8,6 +8,9 @@ vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- For conciseness local opts = { noremap = true, silent = true } +-- This is for CodeCompanion Plugin. I will move this later +vim.keymap.set('n', 'mt', ':CodeCompanionChat Toggle', opts) + -- save file vim.keymap.set('n', '', ' w ', opts) diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index 8164ccd..e99b07a 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -5,6 +5,9 @@ return { 'nvim-treesitter/nvim-treesitter', }, config = { + -- keymaps = { + -- + -- } prompt_library = { ['prompt2prompt'] = { strategy = 'chat', @@ -22,6 +25,22 @@ return { }, }, adapters = { + codellama = function() + return require('codecompanion.adapters').extend('ollama', { + name = 'codellama', -- Give this adapter a different name to differentiate it from the default ollama adapter + schema = { + model = { + default = 'codellama', + }, + -- num_ctx = { + -- default = 16384, + -- }, + -- num_predict = { + -- default = -1, + -- }, + }, + }) + end, llama3 = function() return require('codecompanion.adapters').extend('ollama', { name = 'llama3', -- Give this adapter a different name to differentiate it from the default ollama adapter @@ -57,10 +76,10 @@ return { }, strategies = { chat = { - adapter = 'deepseekr1', + adapter = 'codellama', }, inline = { - adapter = 'deepseekr1', + adapter = 'codellama', }, }, }, diff --git a/lua/plugins/colortheme.lua b/lua/plugins/colortheme.lua index db1d834..332e565 100644 --- a/lua/plugins/colortheme.lua +++ b/lua/plugins/colortheme.lua @@ -6,7 +6,7 @@ return { -- Example config in lua vim.g.nord_contrast = true vim.g.nord_borders = false - vim.g.nord_disable_background = true + vim.g.nord_disable_background = false vim.g.nord_italic = false vim.g.nord_uniform_diff_background = true vim.g.nord_bold = false