242 lines
6.0 KiB
Lua
242 lines
6.0 KiB
Lua
return {
|
|
'yetone/avante.nvim',
|
|
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
|
|
-- ⚠️ must add this setting! ! !
|
|
build = vim.fn.has('win32') ~= 0
|
|
and 'powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false'
|
|
or 'make',
|
|
event = 'VeryLazy',
|
|
version = false, -- Never set this value to '*'! Never!
|
|
---@module 'avante'
|
|
---@type avante.Config
|
|
opts = {
|
|
instructions_file = 'avante.md',
|
|
provider = 'openai',
|
|
auto_suggestions_provider = 'openai',
|
|
providers = {
|
|
claude = {
|
|
endpoint = 'https://api.anthropic.com',
|
|
model = 'claude-sonnet-4-20250514',
|
|
timeout = 30000,
|
|
extra_request_body = {
|
|
temperature = 0.75,
|
|
max_tokens = 4096,
|
|
},
|
|
},
|
|
openai = {
|
|
endpoint = 'https://api.openai.com/v1',
|
|
model = 'gpt-5',
|
|
extra_request_body = {
|
|
timeout = 30000,
|
|
temperature = 0,
|
|
max_completion_tokens = 8192,
|
|
},
|
|
},
|
|
},
|
|
rag_service = {
|
|
enabled = false,
|
|
host_path = '/home/gib/Documents/Code',
|
|
runner = 'docker',
|
|
llm = {
|
|
provider = 'openai',
|
|
endpoint = 'https://api.openai.com/v1',
|
|
api_key = 'OPENAI_API_KEY',
|
|
model = 'gpt-5',
|
|
extra = {
|
|
temperature = 0.7,
|
|
max_tokens = 512,
|
|
timeout = 60,
|
|
},
|
|
},
|
|
embed = {
|
|
provider = 'openai',
|
|
endpoint = 'https://api.openai.com/v1',
|
|
api_key = 'OPENAI_API_KEY',
|
|
model = 'text-embedding-3-large',
|
|
extra = nil,
|
|
},
|
|
docker_extra_args = '',
|
|
},
|
|
web_search_engine = {
|
|
provider = 'searxng',
|
|
proxy = nil,
|
|
},
|
|
system_prompt = function()
|
|
local hub = require('mcphub').get_hub_instance()
|
|
return hub and hub:get_active_servers_prompt() or ''
|
|
end,
|
|
custom_tools = function()
|
|
return {
|
|
require('mcphub.extensions.avante').mcp_tool(),
|
|
}
|
|
end,
|
|
behaviour = {
|
|
auto_suggestions = false,
|
|
auto_set_highlight_group = true,
|
|
auto_set_keymaps = true,
|
|
auto_apply_diff_after_generation = false,
|
|
support_paste_from_clipboard = false,
|
|
minimize_diff = true,
|
|
enable_token_counting = true,
|
|
auto_approve_tool_permissions = true,
|
|
},
|
|
mappings = {
|
|
--- @class AvanteConflictMappings
|
|
diff = {
|
|
ours = 'co',
|
|
theirs = 'ct',
|
|
all_theirs = 'ca',
|
|
both = 'cb',
|
|
cursor = 'cc',
|
|
next = ']x',
|
|
prev = '[x',
|
|
},
|
|
suggestion = {
|
|
accept = '<M-l>',
|
|
next = '<M-]>',
|
|
prev = '<M-[>',
|
|
dismiss = '<C-]>',
|
|
},
|
|
jump = {
|
|
next = ']]',
|
|
prev = '[[',
|
|
},
|
|
submit = {
|
|
normal = '<CR>',
|
|
insert = '<C-s>',
|
|
},
|
|
cancel = {
|
|
normal = { '<C-c>', '<Esc>', 'q' },
|
|
insert = { '<C-c>' },
|
|
},
|
|
sidebar = {
|
|
apply_all = 'A',
|
|
apply_cursor = 'a',
|
|
retry_user_request = 'r',
|
|
edit_user_request = 'e',
|
|
switch_windows = '<Tab>',
|
|
reverse_switch_windows = '<S-Tab>',
|
|
remove_file = 'd',
|
|
add_file = '@',
|
|
close = { '<Esc>', 'q' },
|
|
close_from_input = nil,
|
|
},
|
|
},
|
|
hints = { enabled = true },
|
|
windows = {
|
|
---@type 'right' | 'left' | 'top' | 'bottom'
|
|
position = 'right',
|
|
wrap = true,
|
|
width = 35,
|
|
sidebar_header = {
|
|
enabled = true,
|
|
align = 'center',
|
|
rounded = true,
|
|
},
|
|
input = {
|
|
prefix = '> ',
|
|
height = 8,
|
|
},
|
|
edit = {
|
|
border = 'rounded',
|
|
start_insert = true,
|
|
},
|
|
ask = {
|
|
floating = false,
|
|
start_insert = true,
|
|
border = 'rounded',
|
|
---@type 'ours' | 'theirs'
|
|
focus_on_apply = 'ours',
|
|
},
|
|
},
|
|
highlights = {
|
|
diff = {
|
|
current = 'DiffText',
|
|
incoming = 'DiffAdd',
|
|
},
|
|
},
|
|
--- @class AvanteConflictUserConfig
|
|
diff = {
|
|
autojump = true,
|
|
---@type string | fun(): any
|
|
list_opener = 'copen',
|
|
override_timeoutlen = 500,
|
|
},
|
|
suggestion = {
|
|
debounce = 1000,
|
|
throttle = 1000,
|
|
},
|
|
},
|
|
dependencies = {
|
|
{ 'nvim-lua/plenary.nvim' },
|
|
{ 'MunifTanjim/nui.nvim' },
|
|
{ 'hrsh7th/nvim-cmp' },
|
|
{ 'nvim-treesitter/nvim-treesitter' },
|
|
{ 'stevearc/dressing.nvim' },
|
|
{ 'nvim-tree/nvim-web-devicons' },
|
|
{ 'folke/snacks.nvim' },
|
|
{
|
|
'ravitemer/mcphub.nvim',
|
|
build = "npm install -g mcp-hub@latest",
|
|
config = function()
|
|
require'mcphub'.setup({
|
|
config = vim.fn.expand('/home/gib/.config/mcphub/servers.json'),
|
|
port = 37373,
|
|
shutdown_delay = 60 * 10 * 000,
|
|
use_bundled_binary = false,
|
|
mcp_request_timeout = 60000,
|
|
auto_approve = true,
|
|
auto_toggle_mcp_servers = true,
|
|
extensions = {
|
|
avante = {
|
|
make_slash_commands = true,
|
|
},
|
|
},
|
|
native_servers = {},
|
|
ui = {
|
|
window = {
|
|
width = 0.8,
|
|
height = 0.8,
|
|
align = 'center',
|
|
relative = 'editor',
|
|
zindex = 50,
|
|
border = 'rounded',
|
|
},
|
|
wo = {
|
|
winhl = 'Normal:MCPHubNormal,FloatBorder:MCPHubBorder',
|
|
},
|
|
},
|
|
log = {
|
|
level = vim.log.levels.WARN,
|
|
to_file = false,
|
|
file_path = nil,
|
|
prefix = 'MCPHub',
|
|
},
|
|
})
|
|
end
|
|
},
|
|
{
|
|
-- support for image pasting
|
|
'HakonHarnes/img-clip.nvim',
|
|
event = 'VeryLazy',
|
|
opts = {
|
|
-- recommended settings
|
|
default = {
|
|
embed_image_as_base64 = false,
|
|
prompt_for_file_name = false,
|
|
drag_and_drop = {
|
|
insert_mode = true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
'MeanderingProgrammer/render-markdown.nvim',
|
|
opts = {
|
|
file_types = { 'markdown', 'Avante' },
|
|
},
|
|
ft = { 'markdown', 'Avante' },
|
|
},
|
|
},
|
|
}
|