I would like to configure a git mergetool setting with vanilla Vim 8.2 to open up three tabs:
- Tab A: The merged file (the file that is supposed to be edited)
- Tab B: Diff between base and local file
- Tab C: Diff between base and remote file
Now, I am trying to achieve this from the command line, but the moment Vim opens a new tab it will not open up a new file in the new tab. It almost looks like the tabs feature does not work well with command line arguments:
[mergetool "vimdifftabs"]
cmd = vim -f -c "e $MERGED" -c "tabe $BASE" -c "diffs $LOCAL" -c "tabe $BASE" -c "diffs $REMOTE"
Looks like even this does not work:
[mergetool "vimdifftabs"]
cmd = vim -f -c "e $MERGED" -c "tabe $BASE"
The second tab is empty, no file opened there. When I try to explicitly create the tab first and then edit the file:
[mergetool "vimdifftabs"]
cmd = vim -f -c "e $MERGED" -c tabnew -c "e $BASE"
Vim says: No filename. But I tested that git is passing the base filename correctly in that variable. I am not getting it.
-p
which will open each specified file in its own tab (e.g.vim -p foo.txt bar.txt
will start withfoo.txt
in one tab andbar.txt
in another). Any luck with that?