[ANN] hgmergevim: Vim plugin to enable console Vim as merge tool

Christian Ebert blacktrash at gmx.net
Fri Feb 12 16:08:28 CST 2010


* Will Maier on Thursday, February 11, 2010 at 08:20:55 -0600
> On Thu, Feb 11, 2010 at 02:52:41PM +0100, Christian Ebert wrote:
>> I have created a -- so far very rudimentary -- Vim plugin that
>> allows you to use console Vim for 3-way merges.
> 
> Neat. How does this compare to ui.merge=vimdiff?

Not that much (yet) unfortunately. But I hope it does the
groundwork for extended functionality. 

The main difference (and advantage imho) is that it exits with an
error unless you exit with an explicit command. Vim normally
exits with success, making Mercurial believe there is a succesful
merge, which is a trap for someone like me ;-) This raises the
threshold of "unwanted success".

- exit commands:
  :Merge -  consider current state of $local as successful merge
  :Accept - accept remote ($other) unchanged as merge result
  :Reject - reject $other and keep $local unchanged
  :Discard - reject both $local and $other, but take $base as result

- keeps filetype syntax highlighting (can be turned off/on)
- the $base pane is in the middle (like e.g. in meld), but
  :diffget and :diffput without arguments work on the 1st and 3rd
  pane
- optionally maximizes window if terminal supports (e.g. xterm)

The main TODO item is conflict detection, marking etc. Perhaps I
can steal some stuff from Conflict2Diff
http://www.vim.org/scripts/script.php?script_id=621

c
-- 
  Was heißt hier Dogma, ich bin Underdogma!
[ What the hell do you mean dogma, I am underdogma. ]

_F R E E_  _V I D E O S_  --->>> http://www.blacktrash.org/underdogma/


More information about the Mercurial-devel mailing list