On 2013-08-12, Tony Mechelynck wrote:
> On 12/08/13 22:10, Gary Johnson wrote:
> >On 2013-08-12, Tony Mechelynck wrote:
> >>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.
The last time I installed Vim for Windows (from the Cream site) was
around the first of the year and this was the file installed in
C:\Program Files\vim\_vimrc (i.e., $VIM/_vimrc):
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
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
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '"' . $VIMRUNTIME . '\diff"'
let eq = '""'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
It is not a copy of vimrc_example.vim, it sources vimrc_example.vim.
And it defines MyDiff(). So, one is not left in the cold by later
changes to vimrc_example.vim, but one is by later changes to
MyDiff().
I share the same .vimrc/_vimrc file among all the systems on which I
use Vim. I've found MyDiff() useful even on Linux because it lets
me specify a few extra flags to diff and because it lets me hook the
entry-into-diff-mode event.
> >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.
You're right. I didn't think of it as a user vimrc since it's
shared by all users of the Windows system and I didn't look up the
proper name for it.
Regards,
Gary
--
--
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