On Mon, 2007-08-27 at 20:58 +0200, Kai Borgolte wrote:
> How about my other point?
Sorry, I didn't quite grok it and should have asked...
> The FAQ's answer about config files is IMHO misleading. Here is my
> suggestion, in the hope I understood the procedure:
> How are system-wide customizations loaded? Do user preferences
> override these global settings?
> Order of load is as follows:
> 1. $CREAM . "cream-conf.vim" (sourced by cream.vim)
> 2. g:cream_user . "cream-conf.vim" (sourced by cream.vim)
> 3. ~/.cream/views/.viminfo
> 4. $CREAM . "cream-user.vim" (sourced by VimEnter autocmd event)
> 5. g:cream_user . "cream-user.vim" (sourced by VimEnter autocmd event)
I think the FAQ order is correct:
1. $CREAM . "cream-conf.vim" (sourced by cream.vim)
2. g:cream_user . "cream-conf.vim" (sourced by cream.vim, will
3. $CREAM . "cream-user.vim" (VimEnter autocmd event)
4. g:cream_user . "cream-user.vim" (VimEnter autocmd event)
6. $CREAM . "cream-conf.vim" (BufEnter autocmd event)
7. g:cream_user . "cream-conf.vim" (BufEnter autocmd event, will
overwrite 1 if exists)
although I agree that it isn't very clear. The bottom of cream-autocmd
calls cream-user on event VimEnter which happens prior to viminfo
IIRC. Thus lines 3,4,5. At the top of the same file,
Cream_conf_override() is called by BufEnter, thus lines 6,7.
> Any setting or function found early will be active unless a later
> step overwrites it.
> cream-conf.vim is expected to define and to call a function
> Cream_conf_override() - see cream-conf.example.vim. The same
> function is then assigned to the BufEnter autocmd event. So, if
> present, in 1 the system wide Cream_conf_override() is defined and
> executed once. Then in 2 it is overwritten, if both present, by the
> user Cream_conf_override(), which is called too. Later *with every
> buffer switch* the function will be called again.
> Make global settings as light as possible. Don't set personal
> preferences unless they are mandated for all editing. Even then, a
> personal preference set within a buffer will override anything else
> since no autocmd event will intervene. The user's
> Cream_conf_override() also takes precedence. Power to the people! :)
> OTOH assigning the global config file/function to BufEnter looks
> weird for me. Is it work in progress? For the case of
> g:CREAM_NOVIMPLUGINS I neither see why is has to be set (multiple)
> in Cream_conf_override() nor why it has to be an extra variable at
> all. As far as I can see it is sufficient to set noloadplugins in
> one of the cream-conf.vim outside the function definition.
(I'm not going to get time this evening to discuss this, I'll try to
continue it tomorrow.)
Steve Hall [ digitect dancingpaper com ]
:: Cream... usability for Vim