init
This commit is contained in:
56
lua/plugins/codecompanion.lua
Normal file
56
lua/plugins/codecompanion.lua
Normal file
@ -0,0 +1,56 @@
|
||||
return {
|
||||
{
|
||||
'olimorris/codecompanion.nvim',
|
||||
dependencies = {
|
||||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
-- Test with blink.cmp
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
lazy = false,
|
||||
version = '*',
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = 'enter',
|
||||
['<S-Tab>'] = { 'select_prev', 'fallback' },
|
||||
['<Tab>'] = { 'select_next', 'fallback' },
|
||||
},
|
||||
cmdline = { sources = { 'cmdline' } },
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'buffer', 'codecompanion' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
ollama = function()
|
||||
return require('codecompanion.adapters').extend('ollama', {
|
||||
schema = {
|
||||
model = {
|
||||
default = 'hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest',
|
||||
},
|
||||
num_ctx = {
|
||||
default = 4096,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
allow_insecure = true,
|
||||
},
|
||||
--Refer to: https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/config.lua
|
||||
strategies = {
|
||||
--NOTE: Change the adapter as required
|
||||
chat = {
|
||||
adapter = 'ollama',
|
||||
completion_provider = 'blink', -- blink|cmp|coc|default
|
||||
},
|
||||
inline = { adapter = 'ollama' },
|
||||
cmd = { adapter = 'ollama' },
|
||||
},
|
||||
opts = {
|
||||
log_level = 'DEBUG',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user