update fold method plus fix golangci lint causing error
also add keybinds to codecompanion
This commit is contained in:
@ -65,3 +65,7 @@ vim.o.termguicolors = true
|
|||||||
-- enable spell checking
|
-- enable spell checking
|
||||||
vim.o.spell = true
|
vim.o.spell = true
|
||||||
vim.o.spelllang = 'en_gb'
|
vim.o.spelllang = 'en_gb'
|
||||||
|
|
||||||
|
vim.o.foldmethod = 'expr'
|
||||||
|
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
|
vim.o.foldenable = false
|
||||||
|
|||||||
49
lua/plugins/ai/avante.lua
Normal file
49
lua/plugins/ai/avante.lua
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'yetone/avante.nvim',
|
||||||
|
build = 'make',
|
||||||
|
event = 'VeryLazy',
|
||||||
|
version = false, -- Never set this value to "*"! Never!
|
||||||
|
---@module 'avante'
|
||||||
|
---@type avante.Config
|
||||||
|
opts = {
|
||||||
|
-- add any opts here
|
||||||
|
-- for example
|
||||||
|
provider = 'ollama',
|
||||||
|
providers = {
|
||||||
|
ollama = {
|
||||||
|
model = 'deepseek-r1:8b',
|
||||||
|
timeout = 30000, -- Timeout in milliseconds
|
||||||
|
extra_request_body = {
|
||||||
|
temperature = 0.5,
|
||||||
|
max_tokens = 20480,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selector = {
|
||||||
|
--- @alias avante.SelectorProvider "native" | "fzf_lua" | "mini_pick" | "snacks" | "telescope" | fun(selector: avante.ui.Selector): nil
|
||||||
|
--- @type avante.SelectorProvider
|
||||||
|
provider = 'fzf',
|
||||||
|
-- Options override for custom providers
|
||||||
|
provider_opts = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
--- The below dependencies are optional,
|
||||||
|
'hrsh7th/nvim-cmp', -- autocompletion for avante commands and mentions
|
||||||
|
'ibhagwan/fzf-lua', -- for file_selector provider fzf
|
||||||
|
'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons
|
||||||
|
{
|
||||||
|
-- Make sure to set this up properly if you have lazy=true
|
||||||
|
'MeanderingProgrammer/render-markdown.nvim',
|
||||||
|
opts = {
|
||||||
|
file_types = { 'markdown', 'Avante' },
|
||||||
|
},
|
||||||
|
ft = { 'markdown', 'Avante' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -5,17 +5,21 @@ return {
|
|||||||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
{ 'nvim-lua/plenary.nvim' },
|
||||||
},
|
},
|
||||||
|
keys = {
|
||||||
|
{ '<leader>cc', '<cmd>CodeCompanionChat Toggle<cr>', desc = 'Open AI chat' },
|
||||||
|
{ '<leader>cw', '<cmd>CodeCompanionAction<cr>', desc = 'Start new cody chat' },
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
adapters = {
|
adapters = {
|
||||||
ollama = function()
|
ollama = function()
|
||||||
return require('codecompanion.adapters').extend('ollama', {
|
return require('codecompanion.adapters').extend('ollama', {
|
||||||
schema = {
|
schema = {
|
||||||
model = {
|
model = {
|
||||||
default = 'hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest',
|
default = 'deepseek-r1',
|
||||||
},
|
|
||||||
num_ctx = {
|
|
||||||
default = 4096,
|
|
||||||
},
|
},
|
||||||
|
-- num_ctx = {
|
||||||
|
-- default = 4096,
|
||||||
|
-- },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|||||||
1122
lua/plugins/ai/config.lua
Normal file
1122
lua/plugins/ai/config.lua
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,4 +3,5 @@ if file ~= '' then
|
|||||||
return require 'plugins.ai.cody'
|
return require 'plugins.ai.cody'
|
||||||
else
|
else
|
||||||
return require 'plugins.ai.codecompanion'
|
return require 'plugins.ai.codecompanion'
|
||||||
|
-- return require 'plugins.ai.avante'
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
enable = function() -- disable lsp if wrong version installed
|
enable = function() -- disable lsp if wrong version installed
|
||||||
local enable = true
|
local enable = true
|
||||||
|
local ok, _ = pcall(function()
|
||||||
vim
|
vim
|
||||||
.system({ 'golangci-lint', '--version' }, { text = true }, function(out)
|
.system({ 'golangci-lint', '--version' }, { text = true }, function(out)
|
||||||
if out.code ~= 0 then
|
if out.code ~= 0 then
|
||||||
@ -13,7 +14,8 @@ return {
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
:wait()
|
:wait()
|
||||||
|
end)
|
||||||
|
|
||||||
return enable
|
return enable and ok
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user