avante.nvim icon indicating copy to clipboard operation
avante.nvim copied to clipboard

Thoughts on using default diff mode of neovim

Open nexplor opened this issue 1 year ago • 9 comments

Right now, avante re-implements a lot of functionality for viewing and accepting diffs that can be handled by plain neovim. Instead of modifying the buffer to include all of avante's suggestions, we could open a new vertical split which differs according to the suggestions, and replace these keymaps:

  • ]x]c
  • [x[c
  • ctdo (or dp if we're inside the new buffer)
  • co → nothing (since we already have our existing buffer)

This has the following advantages:

  • More consistency with other operations in neovim
  • Side-by-side diff views, which a lot of people prefer
  • Fewer keystrokes (Can bypass all the cos)
  • Less code for avante

I can send a PR for this if there is interest.

nexplor avatar Aug 28 '24 10:08 nexplor

There's also diffview.nvim which is quite popular

will-lynas avatar Aug 28 '24 10:08 will-lynas

Implementing vertical "diffing" could be a valuable addition. Additionally, integrating optional support for diffview.nvim would likely satisfy many users.

We could also conduct an experiment to determine if these features enhance usability.

pidgeon777 avatar Aug 28 '24 12:08 pidgeon777

diffview.nvim is hard to do, since they have their own tab management interface. For ppl who don't use tabpage, then navigation is very hard.

I don't think there will be one-solution-fit-all case. Seems like what ppl want is to have different view.

aarnphm avatar Aug 28 '24 22:08 aarnphm

I'd like to second the idea of using the native split view and the native key bindings of do and dp. This workflow is already so engrained in me for resolving git conflicts or looking at git diffs it would be really nice to not have to remember another paradigm.

IMO targeting the native diff functionality (rather than the paradigms of a specific plugin) is going to appeal to the widest audience, and should probably be the first step.

trevorwhitney avatar Oct 12 '24 12:10 trevorwhitney

I don't have an opinion about supporting native diff view. Just never use diff in neovim myself (simply I get used to the workflow in the terminal)

btw I only think diff view makes sense if you are doing multiple changes at multiple places in the file. Otherwise it just seems unnecessary.

aarnphm avatar Oct 12 '24 22:10 aarnphm

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 23 '25 02:10 github-actions[bot]

Any news?

pidgeon777 avatar Oct 23 '25 14:10 pidgeon777

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 23 '25 02:11 github-actions[bot]

Bump,

pidgeon777 avatar Nov 23 '25 21:11 pidgeon777