I read Vimdiff and Viewing Differences with Vimdiff plus doing various google searches using things like "vimdiff multiple", "vimdiff git", "vimdiff commands" etc.
When using do or diffg, I get the error "More than two buffers in diff mode, I donβt know which one to use."
When using diffg v: fname_in, I get "There is no corresponding buffer for v: fname_in".
From the vimdiff documentation:
: [range] diffg [et] [bufspec]
Change the current buffer to cancel the difference with another buffer. If [bufspec] is specified, this buffer is used. If [bufspec] refers to the current buffer, then nothing happens. Otherwise, this only works if diff has another Mode buffer.
and more:
When "diffexpr" is not empty, Vim evaluates the receipt of the diff file in the mentioned format. These variables are set to the file names used:
v: source file fname_in
v: fname_new new version of the same file
v: fname_out result diff file
So, I need to get the name bufspec, but the default variables (fname_in, fname_new and fname_out) are not set.
I ran the git mergetool command in the linux window via terminal.
[Edit] Partial solution that raised more questions. I used the "file name" at the bottom of the buffer. This is only half the answer, because sometimes I get a file, there is no error. I believe that it is always a remote version of a file that "does not exist". I suspect this has something to do with git and indexing.
How do you get the bufspec value sequentially when using vimdiff via git -mergetool?
git git-merge vim vimdiff
Elizabeth Buckwalter
source share