GVim as a merge tool for TFS

I want to use GVim as a merge tool for TFS 2010.
I can not understand the arguments for GVim. In particular, the argument% 4, when I use it, I get an empty buffer for it. if I do not use it, I get an error message that I should use.

enter image description here

+8
merge vim tfs2010
source share
2 answers

It may not be entirely your way, but here's how I use GVim for the merge tool.

I set it for a two-way merge: it has a “source” on the left (where I go), and a merge file on the right (it starts with the information for my destination branch).

I installed it like this:

command: C:\Program Files (x86)\Vim\vim73\gvim.exe argument: -c "vert diffsplit %1 " %4 -c "wincmd l|0read %2 |diff" 

What does it do:

  • Reads in the source file on the left and splits the window (-c "vert diffsplit% 1")
  • Opens the merge result on the right side (% 4)
  • Runs a quick script that:
    • Moving in the right window (wincmd l)
    • Reads my existing changes in a branch (0read% 2)
    • Re-runs the diff (diff) algorithm

This allows me to “distinguish” my work from an incoming merge, and keeping the right side will allow the merge.

+2
source share

Your screenshot shows that you are using Vim 7.3. According to the Vim website: http://vim.wikia.com/wiki/Running_diff

At some point, the MyDiff function provided by "Vim without Cream", the installer was changed. Starting with Vim 7.3.138 it is still broken.

However, you can try the following verbose mode options

 command : gvim argument: -V -od %1 %2 
+1
source share

All Articles