Tony Mechelynck wrote:

> On Fri, Sep 9, 2016 at 1:14 PM, Bram Moolenaar <[email protected]> wrote:
> >
> > Christian Brabandt wrote:
> >
> >> here is a small update to the documentation that mentions how to skip
> >> loading the defaults.vim file
> >>
> >> diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
> >> index 14a5f01..2142343 100644
> >> --- a/runtime/doc/starting.txt
> >> +++ b/runtime/doc/starting.txt
> >> @@ -1030,6 +1030,14 @@ If you don't like some of the defaults, you can 
> >> still source defaults.vim and
> >>  revert individual settings.  See the defaults.vim file for hints on how to
> >>  revert each item.
> >>
> >> +                                                       *skip_defaults_vim*
> >> +If you want to skip loading the defaults.vim file, you can set the 
> >> variable
> >> +skip_defaults_vim in your |.vimrc| like this >
> >> +    :let g:skip_defaults_vim = 1
> >> +<
> >> +Note: This must be done in a script that is actually loaded before the 
> >> defaults.vim
> >> +file is read |initialization|
> >> +
> >
> > That's a bit misleading, since when Vim finds a .vimrc file it won't
> > load the defaults.  Thus this really only applies to a system vimrc
> > file.  I have this now:
> >
> >                                                 *skip_defaults_vim*
> > If you use a system-wide vimrc and don't want defaults.vim to change 
> > settings,
> > set the "skip_defaults_vim" variable.
> >
> >
> 
> Note that this will disable defaults.vim _in all cases_, even when
> sourced by vimrc_example.vim or directly by .vimrc. I would put an
> example after the above paragraph, like this:
> 
> Example:
>     if !(filereadable('~/.vimrc') || filereadable('~/_vimrc') ||
> filereadable(expand("$VIM/_vimrc")))
>         let skip_defaults_vim = 'skip'
>     endif

The logic for whether the .vimrc file is used is quite complicated.
That's why we can't make this decision before loading a system vimrc.

I think it's easier to suggest unletting skip_defaults_vim always:


This should work well for new Vim users.  If you create your own .vimrc, it is
recommended to add this line somewhere near the top: >
        unlet! skip_defaults_vim
        source $VIMRUNTIME/defaults.vim

-- 
hundred-and-one symptoms of being an internet addict:
210. When you get a divorce, you don't care about who gets the children,
     but discuss endlessly who can use the email address.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" 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_dev" 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/d/optout.

Raspunde prin e-mail lui