re-organised config
This commit is contained in:
35
lua/plugins/ai/codecompanion.lua
Normal file
35
lua/plugins/ai/codecompanion.lua
Normal file
@ -0,0 +1,35 @@
|
||||
return {
|
||||
{
|
||||
'olimorris/codecompanion.nvim',
|
||||
dependencies = {
|
||||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
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 = {
|
||||
chat = {
|
||||
adapter = 'ollama',
|
||||
completion_provider = 'blink', -- blink|cmp|coc|default
|
||||
},
|
||||
inline = { adapter = 'ollama' },
|
||||
cmd = { adapter = 'ollama' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
20
lua/plugins/ai/cody.lua
Normal file
20
lua/plugins/ai/cody.lua
Normal file
@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
'projects/cdy-nvim',
|
||||
dir = '~/projects/cdy-nvim',
|
||||
cmd = { 'CodyChat', 'CodyAsk', 'CodySetModel', 'CodyToggleFileContext', 'CodyToggleRepoContext', 'CodyNew' },
|
||||
dependencies = {
|
||||
'MunifTanjim/nui.nvim',
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>cc', '<cmd>CodyChat<cr>', desc = 'Open cody chat' },
|
||||
{ '<leader>cn', '<cmd>CodyNew<cr>', desc = 'Start new cody chat' },
|
||||
},
|
||||
dev = true,
|
||||
opts = {
|
||||
include_file = true,
|
||||
include_repo = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
6
lua/plugins/ai/init.lua
Normal file
6
lua/plugins/ai/init.lua
Normal file
@ -0,0 +1,6 @@
|
||||
local file = vim.fn.glob '~/projects/cdy-nvim'
|
||||
if file ~= '' then
|
||||
return require 'plugins.ai.cody'
|
||||
else
|
||||
return require 'plugins.ai.codecompanion'
|
||||
end
|
||||
Reference in New Issue
Block a user