diff currently open buffers

2 Points

Janusz Kowalczyk Janusz Kowalczyk

10 years ago

Press F4 to toggle the diff of currently open

" Press F4 to toggle the diff of currently open buffers/splits.
noremap <F4> :call DiffMe()<CR>
let $diff_me=0
function! DiffMe()
    windo diffthis
    if $diff_me>0
        let $diff_me=0
    else
        windo diffoff
    let $diff_me=1
    endif
endfunction