I'd like to run vimdiff on MacVim. Is there an easy way I'd be able to do it?
Description. Vimdiff starts Vim on two (or three or four) files. Each file gets its own window. The differences between the files are highlighted. This is a nice way to inspect changes and to move changes from one version to another version of the same file.
Vimdiff is a Linux command that can edit two, three, or four versions of a file with Vim and show their differences.
If you have the mvim
script installed (it is in the dmg, just put it somewhere in your PATH
), you can just type in a shell:
mvim -d file1 file2
You can alias this to mvimdiff if you like.
In macvim, like in vim , you can also use:
:e file1 :diffsplit file2 or :vert diffsplit file2
The second option gives you a vertical diff, which is usually more readable
If you symlink gvimdiff to mvim then mvim will start with -d etc. Vim and Mvim both look at what executable name they've been started with to determine how they behave. That how gvim and vim can be both the same executable on linux and it's the same on OSX.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With