localcfg/diff.vimΒΆ

Enforce vim script implementation to reduce ambiguities and improve robustness:

scriptversion 4

Ignore whitespace by default:

set diffopt+=iwhite

Use histogram diff method to match my git configuration:

set diffopt+=algorithm:histogram,indent-heuristic

The remaining functionality is only useful when :autocmd is available.

if !has('autocmd')
    finish
endif

Note

While this may seem like an odd thing to test here, some builds of vim are incredibly bare. This is often the case for console-only builds, which are sometimes the default for tools such as git difftool.

Add my bindings for diff mode:

augroup jnrowe_diff
    autocmd!
    autocmd BufRead * if &diff | call filetypes#diff_maps() | endif
augroup END