Add vim as diff tool

Claus's Avatar


11 Jan, 2012 11:28 PM

I'd like to use Vim as diff tool. From command line I either use:

/usr/local/bin/mvim -d [file1] [file2] – this opens MacVim or
/sw/bin/vimdiff [file1] [file2] – this opens vim within the terminal (vimdiff is equivalent to vim -d)

I tested both variants (absolute path) by entering them in the "For Diffs use: Other ..." option in MacHg's preferences, however, calling diff from within MacHg does not open anything.

How can I make Vim my diff tool of choice?

Thanks for any help.

  1. Support Staff 1 Posted by jason on 12 Jan, 2012 12:04 AM

    jason's Avatar

    First step is to get vim working from the command line... (for hg) and not just as a general diff tool. the diff tools need to be called with the right arguments from extdiff (the external diffing extension which is built into Mercurial.) once you have that going than adding that to MacHg is fairly trivial. Ie most of the hard work is actually external to MacHg...

    I take it you have read right?

  2. jason closed this discussion on 12 Jan, 2012 12:04 AM.

  3. Claus Atzenbeck re-opened this discussion on 12 Jan, 2012 02:01 AM

  4. 2 Posted by Claus Atzenbeck on 12 Jan, 2012 02:01 AM

    Claus Atzenbeck's Avatar

    Thanks for you e-mail. Yes, I saw the web page you're referring to. MacHg is setup to read ~/.hgrc. Below the content of that file; I got the content from <>.

    However, MacHg seems to not recognize vim or mvim.

    In order to further test it, I added the line "editor = /usr/local/bin/mvim", which should open MacVim as editor. However, still the "open -t -n -W" command from hgrc seems to be called. No idea, why ~/.hgrc is not considered. Or do I have to do any additional configuration?

    Thanks for any hint.

    Here comes the content of ~/.hgrc:

    merge = vimmerge


    # vimdiff
    vimdiff.executable = /sw/bin/vim
    vimdiff.args = -d $base $local $output $other +close +close

    # MacVim diff
    mvimdiff.executable = /usr/local/bin/mvim
    mvimdiff.args = -d $base $local $output $other +close +close


    # vim merge
    # Source
    vimmerge.executable = /sw/bin/vim
    vimmerge.args = -d $base $local $output $other +close +close

    # MacVim merge
    mvimmerge.executable = /usr/local/bin/mvim
    mvimmerge.args = -d $base $local $output $other +close +close

  5. 3 Posted by eldajlewis on 03 Jun, 2020 10:45 AM

    eldajlewis's Avatar

    There are numerous apparatuses that we can use for SEO. I saw an article posted on ninja expositions pretty much about all the different apparatuses for SEO. I had no information with respect to it previously yet now I have some information about the best thesis writing service to looking on google and watching two or three instructional exercises.

  6. 4 Posted by gustavowoltmann on 22 Oct, 2020 04:28 AM

    gustavowoltmann's Avatar

    I don't know about this because I have no knowledge of this. So I don't say anything because I am new to this. Gustavo Woltmann

  7. 5 Posted by gustavowoltmann on 09 Nov, 2020 04:20 AM

    gustavowoltmann's Avatar

    Oh great and I can try this trick. Because your information is true and you are well defending for this. Gustavo Woltmann

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • MacHgScreenSnapz001.png 75 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac