Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/yetone/avante.nvim/llms.txt

Use this file to discover all available pages before exploring further.

Avante.nvim provides comprehensive keybindings for all plugin actions. This guide covers all default keybindings and how to customize them.

Default Keybindings

Global Actions

Key BindingDescriptionMode
<leader>aaShow/open sidebarNormal
<leader>anStart new chatNormal
<leader>atToggle sidebar visibilityNormal
<leader>aeEdit selected blocksVisual
<leader>arRefresh sidebarNormal
<leader>afSwitch sidebar focusNormal
<leader>aSStop current AI requestNormal
<leader>a?Select modelNormal
<leader>ahSelect chat historyNormal
<leader>adToggle debug modeNormal
<leader>asToggle suggestion displayNormal
<leader>aCToggle selectionNormal
<leader>aRToggle repomapNormal
<leader>azEnter Zen modeNormal
Key BindingDescriptionMode
]pNext promptNormal
[pPrevious promptNormal
AApply all changesNormal
aApply change at cursorNormal
rRetry user requestNormal
eEdit user requestNormal
<Tab>Switch windowsNormal
<S-Tab>Reverse switch windows / Expand tool useNormal
xToggle code windowNormal
dRemove fileNormal
@Add fileNormal
qClose sidebarNormal

File Management

Key BindingDescriptionMode
<leader>acAdd current buffer to selected filesNormal
<leader>aBAdd all buffer files to selected filesNormal

Suggestion Actions

Key BindingDescriptionMode
<M-l>Accept suggestionInsert
<M-]>Next suggestionInsert
<M-[>Previous suggestionInsert
<C-]>Dismiss suggestionInsert

Diff Navigation

Key BindingDescriptionMode
coChoose oursNormal
ctChoose theirsNormal
caChoose all theirsNormal
cbChoose bothNormal
ccChoose cursorNormal
]xMove to next conflictNormal
[xMove to previous conflictNormal

Jump Actions

Key BindingDescriptionMode
]]Jump to nextNormal
[[Jump to previousNormal

Submit/Cancel Actions

Key BindingDescriptionMode
<CR>Submit (normal mode)Normal
<C-s>Submit (insert mode)Insert
<C-c>, <Esc>, qCancel (normal mode)Normal
<C-c>Cancel (insert mode)Insert

Confirm Window Actions

Key BindingDescriptionMode
<C-w>fFocus confirm windowNormal
cConfirm codeNormal
rConfirm responseNormal
iConfirm inputNormal

Customizing Keybindings

All keybindings can be customized through the mappings configuration:
require('avante').setup({
  mappings = {
    ask = "<leader>aa",
    new_ask = "<leader>an",
    zen_mode = "<leader>az",
    edit = "<leader>ae",
    refresh = "<leader>ar",
    focus = "<leader>af",
    stop = "<leader>aS",
    
    toggle = {
      default = "<leader>at",
      debug = "<leader>ad",
      selection = "<leader>aC",
      suggestion = "<leader>as",
      repomap = "<leader>aR",
    },
    
    sidebar = {
      expand_tool_use = "<S-Tab>",
      next_prompt = "]p",
      prev_prompt = "[p",
      apply_all = "A",
      apply_cursor = "a",
      retry_user_request = "r",
      edit_user_request = "e",
      switch_windows = "<Tab>",
      reverse_switch_windows = "<S-Tab>",
      toggle_code_window = "x",
      remove_file = "d",
      add_file = "@",
      close = { "q" },
      close_from_input = nil, -- e.g., { normal = "<Esc>", insert = "<C-d>" }
      toggle_code_window_from_input = nil, -- e.g., { normal = "x", insert = "<C-;>" }
    },
    
    files = {
      add_current = "<leader>ac",
      add_all_buffers = "<leader>aB",
    },
    
    select_model = "<leader>a?",
    select_history = "<leader>ah",
    
    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>" },
    },
    
    confirm = {
      focus_window = "<C-w>f",
      code = "c",
      resp = "r",
      input = "i",
    },
  },
})

Safe Keymap Setting

Avante.nvim uses safe keymap setting by default. If a keybinding is already in use, Avante will not override it.
To disable auto-setting of keymaps:
behaviour = {
  auto_set_keymaps = false,
}
When auto_set_keymaps = false, you’ll need to manually set all keybindings.

Manual Keybinding Setup

If you disable automatic keymaps, set them manually:
local avante = require('avante')
local api = require('avante.api')

vim.keymap.set('n', '<leader>aa', api.ask, { desc = 'avante: ask' })
vim.keymap.set('n', '<leader>an', api.new_ask, { desc = 'avante: new ask' })
vim.keymap.set('n', '<leader>at', api.toggle, { desc = 'avante: toggle' })
vim.keymap.set('v', '<leader>ae', api.edit, { desc = 'avante: edit' })
vim.keymap.set('n', '<leader>ar', api.refresh, { desc = 'avante: refresh' })
vim.keymap.set('n', '<leader>af', api.focus, { desc = 'avante: focus' })
Some keybindings are only active when the sidebar is open:
sidebar.close_from_input
table | nil
Close sidebar from input window:
close_from_input = {
  normal = "<Esc>",
  insert = "<C-d>"
}
sidebar.toggle_code_window_from_input
table | nil
Toggle code window from input:
toggle_code_window_from_input = {
  normal = "x",
  insert = "<C-;>"
}

Conflict Mapping Customization

Customize diff conflict resolution mappings:
mappings = {
  diff = {
    ours = "co",      -- Choose our changes
    theirs = "ct",    -- Choose their changes
    all_theirs = "ca", -- Choose all their changes
    both = "cb",      -- Choose both changes
    cursor = "cc",    -- Choose change at cursor
    next = "]x",      -- Jump to next conflict
    prev = "[x",      -- Jump to previous conflict
  },
}

Timeout Override

Avoid operator-pending mode issues with diff mappings:
diff = {
  override_timeoutlen = 500, -- milliseconds, -1 to disable
}

Prompt Logger Keybindings

Navigate through prompt logs:
prompt_logger = {
  enabled = true,
  next_prompt = {
    normal = "<C-n>",
    insert = "<C-n>",
  },
  prev_prompt = {
    normal = "<C-p>",
    insert = "<C-p>",
  },
}

Example: Vim-Style Keybindings

Use Vim-style hjkl for navigation:
mappings = {
  sidebar = {
    switch_windows = "<C-j>",
    reverse_switch_windows = "<C-k>",
  },
  
  jump = {
    next = "<C-j>",
    prev = "<C-k>",
  },
  
  diff = {
    next = "<C-j>",
    prev = "<C-k>",
  },
}

Example: Minimal Keybindings

Minimal setup with only essential keybindings:
mappings = {
  ask = "<leader>a",
  toggle = {
    default = "<leader>A",
  },
  sidebar = {
    apply_all = "A",
    close = { "q", "<Esc>" },
  },
}

Integration with Other Plugins

NvimTree Integration

Add files from NvimTree to Avante:
require('neo-tree').setup({
  filesystem = {
    window = {
      mappings = {
        ['oa'] = 'avante_add_files',
      },
    },
    commands = {
      avante_add_files = function(state)
        local node = state.tree:get_node()
        local filepath = node:get_id()
        local relative_path = require('avante.utils').relative_path(filepath)
        
        local sidebar = require('avante').get()
        local open = sidebar:is_open()
        
        if not open then
          require('avante.api').ask()
          sidebar = require('avante').get()
        end
        
        sidebar.file_selector:add_selected_file(relative_path)
        
        if not open then
          sidebar.file_selector:remove_selected_file('neo-tree filesystem [1]')
        end
      end,
    },
  },
})

Commands vs Keybindings

All keybindings have corresponding commands:
KeybindingCommandDescription
<leader>aa:AvanteAskOpen sidebar
<leader>an:AvanteChatNewNew chat
<leader>at:AvanteToggleToggle sidebar
<leader>ae:AvanteEditEdit selection
<leader>ar:AvanteRefreshRefresh
<leader>af:AvanteFocusFocus sidebar
<leader>aS:AvanteStopStop request
<leader>a?:AvanteSwitchProviderSwitch provider
<leader>ah:AvanteHistoryChat history
Use commands directly if you prefer:
:AvanteAsk What does this code do?
:AvanteEdit Refactor this function

Tips

Use :verbose map <leader>aa to check if a keybinding is already in use before setting it.
The ask, new_ask, and other top-level mappings are only set if behaviour.auto_set_keymaps = true.
Sidebar-specific mappings (like apply_all, retry_user_request) are always active when the sidebar is focused.

Build docs developers (and LLMs) love