When I upgraded from Vim7.3 to Vim7.4, I found that Vimdiff's function was not available, and there was always a "cannot read temp file" problem. After I confirmed the access permissions for the Temp folder, I personally felt that the Mydiff () function was out of the question.
Modify Mydiff () as follows, problem solved.
function! Mydiff () Let opt = '-a--binary ' if &diffopt =~ ' icase ' | Let opt = opt. '-I ' | endif if &diffopt =~ ' Iwhite ' | Let opt = opt. '-B ' | endif let arg1 = v:fname_in if arg1 =~ ' | Let arg1 = ' "'. Arg1. '"' | endif Let arg2 = v:fname_new if arg2 =~ ' | Let arg2 = ' "'. Arg2. '"' | endif Let Arg3 = v:fname_out if Arg3 =~ ' | Let Arg3 = ' "'. Arg3. '"' | endif if $VIMRUNTIME =~ "if &sh =~ ' \<cmd ' if Empty (&shellxquote) Let L:shxq_sav = ' ' Set shellxquote& endif let cmd = ' '. $VIMRUNTIME. ' \diff ' ' else let cmd = substitute ($VIMRUNTIME, ' ', ' "', '). ' \diff "' endif else let cmd = $VIMRUNTIME. ' \diff ' endif "Echo '!". Cmd. ' ' . Opt. Arg1. ' ' . Arg2. ' > '. Arg3 Silent execute '! '. Cmd. ' ' . Opt. Arg1. ' ' . Arg2. ' > '. Arg3 if exists (' L:shxq_sav ') let &shellxquote=l:shxq_sav endif endfunction