On 12/08/13 20:32, Marcio Gil wrote:
Em 12/08/2013 12:16, Ben Fritz escreveu:
On Monday, August 12, 2013 7:59:03 AM UTC-5, Marcio Gil wrote:
I installed vim 7.4 today. Now the "Diff with vim" option don't work.
E810: Cannot read or write temp files
E97: Cannot create diffs

As Tony suggested, check the value you have for 'diffexpr'.

I just did a fresh install of Vim 7.4 and did:

gvim -N -u NONE -i NONE
:source $VIMRUNTIME/vimrc_example.vim

This actually leaves 'diffexpr' empty.

I was then able to view a diff without seeing any error messages.

Vim is also using the correct 'diff.exe' distributed with Vim:

:!start cmd
C:\Users\btfritz>where diff
C:\Program Files (x86)\vim\vim74\diff.exe

I guess probably your diffexpr is not correct.

:set diffexpr?
diffexpr=MyDiff()

then I put the line:
   echo '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq

before this in the _vimrc (copied from vimrc_example.vim):
   silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' .
arg3 . eq

:vert diffsp vimrc~
!""C:\Program Files (x86)\Vim\vim74\diff" -a --binnary
C:\Users\Marcio\AppData\Local\Temp\VIo4C8B.tmp
C:\Users\Marcio\AppData\Local\Temp\VIn4C8C.tmp >
C:\Users\Marcio\AppData\Local\Temp\VId4C8D.tmp"
E810: Cannot read or write temp files
E97: Cannot create diffs

I just remove the MyDiff() function from _vimrc then the diff works!
It is Ok for me, but is there a failure in the Vim instalation?


No. Your _vimrc is not part of the Vim installation. If you made an unwarranted change in your vimrc, and removing that change cures your problem, well, what can I say? Starting Vim as
        vim -u NONE -N
or even as
        C:
        cd "\Program Files (x86)\vim\vim74"
        vim -u .\vimrc_example.vim
ought to work. Making sure that your vimrc is sane is up to you.





Where was that 'diffexpr' set?

        :verbose set diffexpr?

There is no MyDiff() in the vimrc_example.vim for Vim 7.4, but there is one under ":help diff-diffexpr". Are you sure you copied it exactly? What you typed above doesn't look the same to me as what I see in the help. Where is the "cmd" variable set? How come you got --binnary with two n's? This is what _I_ see in the help:

Example (this does almost the same as 'diffexpr' being empty): >

        set diffexpr=MyDiff()
        function MyDiff()
           let opt = ""
           if &diffopt =~ "icase"
             let opt = opt . "-i "
           endif
           if &diffopt =~ "iwhite"
             let opt = opt . "-b "
           endif
           silent execute "!diff -a --binary " . opt . v:fname_in . " " . 
v:fname_new .
                \  " > " . v:fname_out
        endfunction

The "-a" argument is used to force comparing the files as text, comparing as
binaries isn't useful.  The "--binary" argument makes the files read in binary
mode, so that a CTRL-Z doesn't end the text on DOS.

Notice v:fname_in, v:fname_out and v:fname_new which aren't the same as arg1 arg2 arg3.



Best regards,
Tony.
--
I am NOMAD!


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to