avante.nvim-5.lua
· 2.8 KiB · Lua
Raw
{
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string
provider = "claude", -- Recommend using Claude
auto_suggestions_provider = "claude", -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-3-5-sonnet-20241022",
temperature = 0,
max_tokens = 4096,
},
behaviour = {
auto_suggestions = false, -- Experimental stage
auto_set_highlight_group = true,
auto_set_keymaps = true,
auto_apply_diff_after_generation = false,
support_paste_from_clipboard = false,
},
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>",
},
sidebar = {
apply_all = "A",
apply_cursor = "a",
switch_windows = "<Tab>",
reverse_switch_windows = "<S-Tab>",
},
},
hints = { enabled = true },
windows = {
---@type "right" | "left" | "top" | "bottom"
position = "right", -- the position of the sidebar
wrap = true, -- similar to vim.o.wrap
width = 30, -- default % based on available width
sidebar_header = {
enabled = true, -- true, false to enable/disable the header
align = "center", -- left, center, right for title
rounded = true,
},
input = {
prefix = "> ",
height = 8, -- Height of the input window in vertical layout
},
edit = {
border = "rounded",
start_insert = true, -- Start insert mode when opening the edit window
},
ask = {
floating = false, -- Open the 'AvanteAsk' prompt in a floating window
start_insert = true, -- Start insert mode when opening the ask window
border = "rounded",
---@type "ours" | "theirs"
focus_on_apply = "ours", -- which diff to focus after applying
},
},
highlights = {
---@type AvanteConflictHighlights
diff = {
current = "DiffText",
incoming = "DiffAdd",
},
},
--- @class AvanteConflictUserConfig
diff = {
autojump = true,
---@type string | fun(): any
list_opener = "copen",
--- Override the 'timeoutlen' setting while hovering over a diff (see :help timeoutlen).
--- Helps to avoid entering operator-pending mode with diff mappings starting with `c`.
--- Disable by setting to -1.
override_timeoutlen = 500,
},
}
1 | { |
2 | ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string |
3 | provider = "claude", -- Recommend using Claude |
4 | auto_suggestions_provider = "claude", -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot |
5 | claude = { |
6 | endpoint = "https://api.anthropic.com", |
7 | model = "claude-3-5-sonnet-20241022", |
8 | temperature = 0, |
9 | max_tokens = 4096, |
10 | }, |
11 | behaviour = { |
12 | auto_suggestions = false, -- Experimental stage |
13 | auto_set_highlight_group = true, |
14 | auto_set_keymaps = true, |
15 | auto_apply_diff_after_generation = false, |
16 | support_paste_from_clipboard = false, |
17 | }, |
18 | mappings = { |
19 | --- @class AvanteConflictMappings |
20 | diff = { |
21 | ours = "co", |
22 | theirs = "ct", |
23 | all_theirs = "ca", |
24 | both = "cb", |
25 | cursor = "cc", |
26 | next = "]x", |
27 | prev = "[x", |
28 | }, |
29 | suggestion = { |
30 | accept = "<M-l>", |
31 | next = "<M-]>", |
32 | prev = "<M-[>", |
33 | dismiss = "<C-]>", |
34 | }, |
35 | jump = { |
36 | next = "]]", |
37 | prev = "[[", |
38 | }, |
39 | submit = { |
40 | normal = "<CR>", |
41 | insert = "<C-s>", |
42 | }, |
43 | sidebar = { |
44 | apply_all = "A", |
45 | apply_cursor = "a", |
46 | switch_windows = "<Tab>", |
47 | reverse_switch_windows = "<S-Tab>", |
48 | }, |
49 | }, |
50 | hints = { enabled = true }, |
51 | windows = { |
52 | ---@type "right" | "left" | "top" | "bottom" |
53 | position = "right", -- the position of the sidebar |
54 | wrap = true, -- similar to vim.o.wrap |
55 | width = 30, -- default % based on available width |
56 | sidebar_header = { |
57 | enabled = true, -- true, false to enable/disable the header |
58 | align = "center", -- left, center, right for title |
59 | rounded = true, |
60 | }, |
61 | input = { |
62 | prefix = "> ", |
63 | height = 8, -- Height of the input window in vertical layout |
64 | }, |
65 | edit = { |
66 | border = "rounded", |
67 | start_insert = true, -- Start insert mode when opening the edit window |
68 | }, |
69 | ask = { |
70 | floating = false, -- Open the 'AvanteAsk' prompt in a floating window |
71 | start_insert = true, -- Start insert mode when opening the ask window |
72 | border = "rounded", |
73 | ---@type "ours" | "theirs" |
74 | focus_on_apply = "ours", -- which diff to focus after applying |
75 | }, |
76 | }, |
77 | highlights = { |
78 | ---@type AvanteConflictHighlights |
79 | diff = { |
80 | current = "DiffText", |
81 | incoming = "DiffAdd", |
82 | }, |
83 | }, |
84 | --- @class AvanteConflictUserConfig |
85 | diff = { |
86 | autojump = true, |
87 | ---@type string | fun(): any |
88 | list_opener = "copen", |
89 | --- Override the 'timeoutlen' setting while hovering over a diff (see :help timeoutlen). |
90 | --- Helps to avoid entering operator-pending mode with diff mappings starting with `c`. |
91 | --- Disable by setting to -1. |
92 | override_timeoutlen = 500, |
93 | }, |
94 | } |