On 12/08/13 22:10, Gary Johnson wrote:
> On 2013-08-12, Tony Mechelynck wrote:
>> 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.
>
> That's not true. On Windows, at least prior to Vim 7.4, _vimrc _is_
> part of the Vim installation. MyDiff() is/was part of the standard
> _vimrc installed under C:\Program Files\Vim (the XP path).
Installing a _vimrc for you the first time is an option, and the
installer does it IIRC by copying the vimrc_example.vim, which leaves
you in the cold if a later version of Vim comes with a different
vimrc_example.vim.
Rather than use that preinstalled vimrc, I write my own, with the line
runtime vimrc_example.vim
followed (or, in rare cases, preceded) by my own customizations and
overrides. This means any changes in the vimrc_example.vim between one
version and the next are automagically taken in, and if there are things
I don't like in this new stuff I can still override them after coming
back from the :runtime command.
>
> I've been bitten by this before, where I made changes to that
> _vimrc, then updated to a newer version of Vim but excluded _vimrc
> from the update and couldn't execute diffs because the new version
> of Vim had changed MyDiff().
>
> Now I save my old _vimrc, let the installer create a new _vimrc, and
> check the differences.
>
> I've also stopped using that system _vimrc and use ~/_vimrc instead,
> but I still check for changes to the system _vimrc.
$VIM/_vimrc is not a "system vimrc", it is one possible location on
DOS/Windows for the "user vimrc" on single-user systems where $HOME has
no sane value. The system vimrc is (by default) $VIM/vimrc without the
leading dot or underscore. Using $HOME/_vimrc or $HOME/.vimrc is better:
it frees your own vimrc from being at a location defined by the
installation directory, and, on multiuser systems, it allows a different
vimrc for each user. A new development in Vim 7.3.1178 and later, not
backward compatible but allowing to place Vim on a USB stick, is to use
~/.vim/vimrc (or, on Windows, ~/vimfiles/_vimrc) so all your
user-customization files are in a single directory.
On my Linux system, the Vim executables which come from my distro are
compiled with a system vimrc at /etc/vimrc instead, so my own-compiled
builds look at the default $VIM/vimrc and find nothing there, which is
exactly what I want. (My user vimrc is, of course, at $HOME/.vimrc)
>
> Regards,
> Gary
>
Best regards,
Tony.
--
Jesuit priests are DATING CAREER DIPLOMATS!!
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Monday, August 12, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment