Problem with "Cannot read temp file" appears with Vimdiff

Source: Internet
Author: User
Tags diff

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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.