Add vim as diff tool
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.
-
MacHgScreenSnapz001.png 75 KB
Keyboard shortcuts
Generic
? | 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
Support Staff 1 Posted by jason on 12 Jan, 2012 12:04 AM
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 http://machghelp.jasonfharris.com/kb/general/how-do-i-change-the-di... right?
jason closed this discussion on 12 Jan, 2012 12:04 AM.
Claus Atzenbeck re-opened this discussion on 12 Jan, 2012 02:01 AM
2 Posted by Claus Atzenbeck on 12 Jan, 2012 02:01 AM
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 <http://mercurial.selenic.com/wiki/MergingWithVim>.
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.
Claus
Here comes the content of ~/.hgrc:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ui]
merge = vimmerge
[extdiff]
# 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
[merge-tools]
# vim merge
# Source http://mercurial.selenic.com/wiki/MergingWithVim
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 Posted by eldajlewis on 03 Jun, 2020 10:45 AM
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.
4 Posted by gustavowoltmann on 22 Oct, 2020 04:28 AM
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
5 Posted by gustavowoltmann on 09 Nov, 2020 04:20 AM
Oh great and I can try this trick. Because your information is true and you are well defending for this. Gustavo Woltmann