astrocommunity icon indicating copy to clipboard operation
astrocommunity copied to clipboard

avante keybindings are missing or confusing

Open robtandy opened this issue 8 months ago • 15 comments

Checklist

  • [x] I have searched through the AstroNvim documentation
  • [x] I have searched through the existing issues of this project
  • [x] I have searched the existing issues of plugins related to this issue
  • [x] I can replicate the bug with the minimal repro.lua provided below

Neovim version (nvim -v)

0.11

Operating system/version

macOs 15.4

Terminal/GUI

kitty

Describe the bug

The avante plugin lists keybindings for accepting diffs and moving among diffs.

When using the avante community plugin, those keybindings do not seem available. The ones under <leader>A are there, but the other ones are not.

They look like they were removed in this commit.

https://github.com/AstroNvim/astrocommunity/commit/f401d9b0b5a4e019c5d32f3d4932136a4ca30505

Steps to Reproduce

  • Load the avante community plugin and open a file that brings up Avante bindings
  • <leader>A bindings work, but the other ones seem absent.

Expected behavior

I expect the key bindings to work as described or similarly in the avante documentation.

Screenshots

No response

Additional Context

No response

Minimal configuration

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  -- stylua: ignore
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

-- install plugins
local plugins = {
  { "AstroNvim/AstroNvim", import = "astronvim.plugins" },
  { "AstroNvim/astrocommunity" },
  { import = "astrocommunity.pack.lua" },
  { import = "astrocommunity.completion.copilot-lua" },
  {import = "astrocommunity.completion.avante-nvim" },


  -- add any other plugins/customizations here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here (autocommands, vim.filetype, etc.)

robtandy avatar Apr 26 '25 14:04 robtandy

Avante sets up keybindings itself in its options. The plugin by default is loaded when a file is open. This could be changed to just load the plugin on start-up or something.

mehalter avatar Apr 26 '25 14:04 mehalter

I observe that the plugin does get loaded upon file open, but the keybindings other than <leaderA> ones do not seem available.

robtandy avatar Apr 26 '25 14:04 robtandy

The keybindings for accepting diffs arent underneath <Leader>A, they are co,ca, etc. And they appear when you cursor is inside a diff. Like this(I dont have the mappings defined in my config):

Image

Uzaaft avatar Apr 26 '25 15:04 Uzaaft

Ok. I am seeing this work as expected when I use claude but not when my model is copilot. I had not tried claude previously

In that case when I ask it to make a change and it shows me the suggested change. The bindings are not present.

robtandy avatar Apr 26 '25 15:04 robtandy

If I select the copilot and restart nvim and ask avante for a change, i do not get the bindings that let me add the change.

If I select claude and restart nvim and ask avante for a change, the bindings work.

robtandy avatar Apr 26 '25 15:04 robtandy

Did you setup the copilot provider correctly?

Yorizel avatar Apr 26 '25 16:04 Yorizel

Yes, copilot works fine on its own and I was using it with chat and autocomplete before trying avante.

robtandy avatar Apr 26 '25 16:04 robtandy

Can you provide me with your current avante.lua file?

Yorizel avatar Apr 26 '25 16:04 Yorizel

I'm using the community pack with no edits. my community file is

-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE

-- AstroCommunity: import any community modules here
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
-- This guarantees that the specs are processed before any user plugins.

---@type LazySpec
return {
  "AstroNvim/astrocommunity",
  { import = "astrocommunity.pack.lua" },
  { import = "astrocommunity.pack.rust" },
  { import = "astrocommunity.pack.python" },
  { import = "astrocommunity.pack.proto" },
  { import = "astrocommunity.pack.bash" },
  { import = "astrocommunity.pack.docker" },
  { import = "astrocommunity.pack.go" },
  { import = "astrocommunity.pack.json" },
  --{ import = "astrocommunity.completion.copilot-vim-cmp" },
  --{ import = "astrocommunity.completion.copilot-lua" },
  { import = "astrocommunity.completion.avante-nvim" },
  { import = "astrocommunity.markdown-and-latex.render-markdown-nvim" },

  -- import/override with your plugins folder
}

robtandy avatar Apr 26 '25 16:04 robtandy

You shouldnt comment the copilot.lua fron the community file

Yorizel avatar Apr 26 '25 16:04 Yorizel

Oh sorry, when i have that uncommented, is what i mean. I had it commented out when i posted it to use claude, which works for me.

I am using { import = "astrocommunity.completion.copilot-lua" }

robtandy avatar Apr 26 '25 16:04 robtandy

You can left it uncommented, to switch providers just use the "A?" keybind, but for more control i would recommend you to just copy the init.lua from the community repo and add custom vendors on the copilot spec

Yorizel avatar Apr 26 '25 16:04 Yorizel

Can this be closed now?

azdanov avatar May 24 '25 13:05 azdanov