Advertisement
Guest User

_vimrc

a guest
Nov 12th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.98 KB | None | 0 0
  1. source $VIMRUNTIME/vimrc_example.vim
  2. source $VIMRUNTIME/mswin.vim
  3. behave mswin
  4.  
  5. set diffexpr=MyDiff()
  6. function MyDiff()
  7.   let opt = '-a --binary '
  8.   if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  9.   if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  10.   let arg1 = v:fname_in
  11.   if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  12.   let arg2 = v:fname_new
  13.   if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  14.   let arg3 = v:fname_out
  15.   if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  16.   if $VIMRUNTIME =~ ' '
  17.     if &sh =~ '\<cmd'
  18.       if empty(&shellxquote)
  19.         let l:shxq_sav = ''
  20.         set shellxquote&
  21.       endif
  22.       let cmd = '"' . $VIMRUNTIME . '\diff"'
  23.     else
  24.       let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
  25.     endif
  26.   else
  27.     let cmd = $VIMRUNTIME . '\diff'
  28.   endif
  29.   silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  30.   if exists('l:shxq_sav')
  31.     let &shellxquote=l:shxq_sav
  32.   endif
  33. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement