" http://www.axisym3.net/jdany/vim-the-editor/#oceanblack256 if exists("loaded_svndiff") || &compatible finish endif let loaded_svndiff = 1 command! -nargs=? SVNDiff :call s:Svndiff() function! s:Svndiff(...) if a:0 > 1 let rev = a:1 else let rev = 'BASE' endif let ftype = &filetype " Check out the revision to a temp file let tmpfile = tempname() let cmd = "svn cat -r " . rev . " " . expand("%:p") . " > " . tmpfile let cmd_output = system(cmd) if v:shell_error && cmd_output != "" echohl WarningMsg | echon cmd_output return endif " Begin diff exe "vert diffsplit" . tmpfile exe "set filetype=" . ftype set foldmethod=diff wincmd l endfunction