Skip to content

Instantly share code, notes, and snippets.

@xenophy
Created November 24, 2014 15:48
Show Gist options
  • Save xenophy/d37badeeea7b0a1a7b09 to your computer and use it in GitHub Desktop.
Save xenophy/d37badeeea7b0a1a7b09 to your computer and use it in GitHub Desktop.
run "ksdiff" using left and right directory path on VimFiler
" 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>
@xenophy
Copy link
Author

xenophy commented Nov 25, 2014

changed to one liner.

map <F8> :call system("ksdiff " . b:vimfiler.current_dir . " " . vimfiler#get_another_vimfiler().current_dir)<CR>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment