Avante.nvim’s behavior settings control how the plugin interacts with your code, handles suggestions, and manages various features.
Auto-Focus Settings
Automatically focus the sidebar when opening Avante
behaviour.auto_focus_on_diff_view
Automatically focus the diff view when changes are applied
behaviour = {
auto_focus_sidebar = true,
auto_focus_on_diff_view = false,
}
Auto-Suggestions
behaviour.auto_suggestions
Enable automatic code suggestions (experimental)
behaviour.auto_suggestions_respect_ignore
Respect gitignore patterns when generating auto-suggestions
Debounce time in milliseconds before triggering auto-suggestions
Throttle time in milliseconds for auto-suggestions
behaviour = {
auto_suggestions = false, -- Still experimental
auto_suggestions_respect_ignore = false,
},
suggestion = {
debounce = 600,
throttle = 600,
}
Auto-suggestions are high-frequency operations and can be expensive. Avoid using expensive providers like Copilot for auto-suggestions. Consider using a separate, cheaper provider via auto_suggestions_provider.
Keymap Settings
behaviour.auto_set_keymaps
Automatically set keymaps for Avante actions. Only sets keymaps that aren’t already bound.
behaviour = {
auto_set_keymaps = true,
}
Diff Handling
behaviour.auto_apply_diff_after_generation
Automatically apply diff after LLM response (similar to Cursor’s behavior)
Remove unchanged lines when applying code blocks to reduce clutter
behaviour.jump_result_buffer_on_finish
Automatically jump to the result buffer after generation completes
behaviour = {
auto_apply_diff_after_generation = false,
minimize_diff = true,
jump_result_buffer_on_finish = false,
}
Diff Configuration
Automatically jump to diff conflicts
Override timeoutlen while hovering over diff to avoid operator-pending mode. Set to -1 to disable.
diff = {
autojump = true,
override_timeoutlen = 500,
}
Highlight Groups
behaviour.auto_set_highlight_group
Automatically set highlight groups for Avante windows
behaviour = {
auto_set_highlight_group = true,
}
Clipboard Support
behaviour.support_paste_from_clipboard
Enable pasting images from clipboard (requires img-clip.nvim)
behaviour = {
support_paste_from_clipboard = false, -- Auto-detected if img-clip is installed
}
This is automatically enabled if img-clip.nvim is installed.
Token Counting
behaviour.enable_token_counting
Enable token counting for requests and responses
behaviour = {
enable_token_counting = true,
}
File Management
behaviour.auto_add_current_file
Automatically add the current file when opening a new chat
behaviour.use_cwd_as_project_root
Use current working directory as project root instead of detecting via LSP
behaviour.allow_access_to_git_ignored_files
Allow AI to access files that are in .gitignore
behaviour = {
auto_add_current_file = true,
use_cwd_as_project_root = false,
allow_access_to_git_ignored_files = false,
}
behaviour.auto_approve_tool_permissions
boolean | string[]
default:"true"
Control tool permission prompts:
true - Auto-approve all tools (no prompts)
false - Show permission prompts for all tools
string[] - Auto-approve specific tools only
-- Auto-approve all tools (default)
behaviour = {
auto_approve_tool_permissions = true,
}
-- Show prompts for all tools
behaviour = {
auto_approve_tool_permissions = false,
}
-- Auto-approve only specific tools
behaviour = {
auto_approve_tool_permissions = { "bash", "str_replace", "read_file" },
}
Diagnostics
behaviour.auto_check_diagnostics
Automatically check and include diagnostics in AI context
behaviour = {
auto_check_diagnostics = true,
}
Fast Apply
behaviour.enable_fastapply
Enable Fast Apply feature for instant code edits using specialized models
behaviour = {
enable_fastapply = false,
}
Git Integration
behaviour.include_generated_by_commit_line
Add a “Generated-by: provider/model” line to git commit messages
behaviour = {
include_generated_by_commit_line = false,
}
Confirmation UI Style
behaviour.confirmation_ui_style
'popup' | 'inline_buttons'
default:"inline_buttons"
Style of confirmation UI:
popup - Original floating window with yes/all/no buttons
inline_buttons - Inline buttons in the sidebar
behaviour = {
confirmation_ui_style = "inline_buttons",
}
ACP Agent Settings
behaviour.acp_follow_agent_locations
Automatically open files and navigate to lines when ACP agent makes edits
behaviour = {
acp_follow_agent_locations = true,
}
Selection Settings
Enable selection mode for asking questions about selected code
selection.hint_display
'delayed' | 'immediate' | 'none'
default:"delayed"
When to show keymap hints for selection mode
selection = {
enabled = true,
hint_display = "delayed", -- delayed | immediate | none
}
History Settings
Maximum tokens to keep in chat history
history.carried_entry_count
number | nil
default:"nil"
Number of history entries to carry over to new chats
Path where chat history is stored
history = {
max_tokens = 4096,
carried_entry_count = nil,
storage_path = vim.fn.stdpath("state") .. "/avante",
}
Prompt Logger
Enable logging prompts to disk for debugging/replay
Directory where prompt logs are saved
prompt_logger.max_entries
Maximum number of prompt log entries to keep
prompt_logger = {
enabled = true,
log_dir = vim.fn.stdpath("cache"),
max_entries = 100,
next_prompt = {
normal = "<C-n>",
insert = "<C-n>",
},
prev_prompt = {
normal = "<C-p>",
insert = "<C-p>",
},
}
Complete Behavior Configuration Example
require('avante').setup({
behaviour = {
-- Focus
auto_focus_sidebar = true,
auto_focus_on_diff_view = false,
-- Suggestions
auto_suggestions = false,
auto_suggestions_respect_ignore = false,
-- Keymaps and highlights
auto_set_keymaps = true,
auto_set_highlight_group = true,
-- Diff handling
auto_apply_diff_after_generation = false,
minimize_diff = true,
jump_result_buffer_on_finish = false,
-- Features
support_paste_from_clipboard = false,
enable_token_counting = true,
enable_fastapply = false,
-- File management
auto_add_current_file = true,
use_cwd_as_project_root = false,
allow_access_to_git_ignored_files = false,
-- Tool permissions
auto_approve_tool_permissions = true,
-- Diagnostics
auto_check_diagnostics = true,
-- Git
include_generated_by_commit_line = false,
-- UI
confirmation_ui_style = "inline_buttons",
-- ACP
acp_follow_agent_locations = true,
},
selection = {
enabled = true,
hint_display = "delayed",
},
diff = {
autojump = true,
override_timeoutlen = 500,
},
suggestion = {
debounce = 600,
throttle = 600,
},
history = {
max_tokens = 4096,
carried_entry_count = nil,
storage_path = vim.fn.stdpath("state") .. "/avante",
},
prompt_logger = {
enabled = true,
log_dir = vim.fn.stdpath("cache"),
max_entries = 100,
},
})
Tips
Start with auto_suggestions = false until you’re comfortable with the plugin, as auto-suggestions can be distracting initially.
Enable minimize_diff = true to reduce clutter when reviewing AI-generated changes.
Use auto_approve_tool_permissions = false in sensitive environments where you want explicit control over what the AI can do.
Set enable_fastapply = true with Morph provider for instant code edits without delays.