sponsor Vim development Vim logo Vim Book Ad

vimdiffext : An easier way to vim-diff files and directories.

 script karma  Rating 16/9, Downloaded by 2284  Comments, bugs, improvements  Vim wiki

created by
Yuriy Ershov
 
script type
ftplugin
 
description
Adds some more handling for diff output.

The most useful probably for multi-file and recursive diffs which are not supported originally.

To use it, just open a patch file or do something like:
$ diff -r -u folder1 folder2 | vim -R -

The added features are:

1. Folds for each individual file and each diff block within.
Since there are no folds originally defined for diff filetype, I added what it made sense for me.

2. A command to open a side-by-side diff mode in a new tab.
The new command is DD (stands for DoDiff) and keymap for it <leader>d (\d for me) in diff file.

To invoke it,
place the cursor on line containing the diff command line:
....
diff [options ...] file1 file2
....
and type :DD
or press \d
... a new tab with side-by-side diff mode will appear.

The files must be accessible by their paths from the current location.

3. Paragraph and section motions: [[ ]] { } move to the next/previous difference/file.


This is the most light-weight and easy solution to compare or sync two folders (recursively) using vim.
 
install details
1. Unpack into your vim home directory (~/.vim/ for Unixes, _vim for Windows):

    $ cd ~/.vim ; tar zxf ~/Downloads/vimdiffext.tgz

2. Enjoy
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vimdiffext.tgz 1.0.1 2016-01-25 7.0 Yuriy Ershov * Added paragraph motion to diff mode.
* In vertical diff, the left and the right files are always on their correspondent sides.
vimdiffext.tgz 1.0.0 2016-01-14 7.0 Yuriy Ershov Initial upload
ip used for rating: 18.97.9.172

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github