Search code examples
vimcomparevimdiff

Exclude one of the split windows from diff in vimdiff 3+ window


As per the subj, I'm looking for a way to exclude one of the split windows in vimdiff yet still compare the other 2+ windows (with colors and all that jazz).

A use case: a file with keys and 2 files with values (same number of lines). I want to compare only the values but have the keys in the view still (without having to open two terminals). This would also allow for parallel scrolling, which is a feature of vimdiff.


Solution

  • :help :diffoff lists all the options which are reset by the command. Based on your description, you only want to reset the actual diff highlighting (which is controlled by the 'diff' option), but keep things like 'scrollbind' etc. So, just clear that option:

    :setlocal nodiff
    

    You can still use :diffoff later to completely turn off the diff.