Created
November 24, 2014 15:48
-
-
Save xenophy/d37badeeea7b0a1a7b09 to your computer and use it in GitHub Desktop.
run "ksdiff" using left and right directory path on VimFiler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" It's just write following code to your .vimrc. | |
" Last line specified keybind to "F8". | |
function! Extcute_ksdiff() "{{{ | |
let current_nr = winnr() | |
let bufnr = 1 | |
let leftwin = "" | |
let rightwin = "" | |
while bufnr <= winnr('$') | |
if getwinvar(bufnr, '&filetype') ==# 'vimfiler' | |
execute bufnr . 'wincmd w' | |
if bufnr ==# 1 | |
let leftwin=b:vimfiler.current_dir | |
else | |
let rightwin=b:vimfiler.current_dir | |
endif | |
endif | |
let bufnr += 1 | |
endwhile | |
execute current_nr . 'wincmd w' | |
call system("ksdiff " . leftwin . " " . rightwin) | |
endfunction"}}} | |
map <F8> :call Extcute_ksdiff()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
changed to one liner.