Re: [cream] FAQ corrections
Cream is a free, easy-to-use configuration of the Vim text editor
Brought to you by:
digitect
From: Kai B. <Kai...@gm...> - 2007-08-29 09:43:26
|
On Tue, 28 Aug 2007 07:06:32 -0700, Steve Hall wrote: >Ok, let's try to sort this out. Based on your previous correction that >viminfo is read prior to VimEnter, it looks like we should re-write >the load order like this: > > 1. $CREAM . "cream-conf.vim" [cream.vim] > 2. g:cream_user . "cream-conf.vim" [cream.vim] (overwrites 1 if > exists) > 3. ~/.cream/views/.viminfo [cream.vim] > 4. $CREAM . "cream-user.vim" [cream-autocmd.vim] (VimEnter event) > 5. g:cream_user . "cream-user.vim" [cream-autocmd.vim] (VimEnter > event) > 6. $CREAM . "cream-conf.vim" [cream-autocmd.vim] (BufEnter event) > 7. g:cream_user . "cream-conf.vim" [cream-autocmd.vim] (BufEnter > event, overwrites 6 if exists) 6 and 7 still state that two vim script files are sourced. But in fact = only one function ist called. That did confuse me and shouldn't be left out. Moreover, cream-conf.vim is created by the user. Cream doesn't provide a cream-conf.vim, but only an example file. So it is up to the user what cream-conf.vim does. It is a (strong) recommendation that cream-conf.vim = defines Cream_conf_override(), but it isn't required and the user may keep it = simpler. Give me another try: 1. $CREAM . "cream-conf.vim" [cream.vim] If present, this may/should define and call a function named Cream_conf_override(). See cream-conf.example.vim. 2. g:cream_user . "cream-conf.vim" [cream.vim] If present, this may/ should define/overwrite the function=20 Cream_conf_override() and call it. 3. ~/.cream/views/.viminfo [cream.vim] 4. $CREAM . "cream-user.vim" [cream-autocmd.vim] (VimEnter event) 5. g:cream_user . "cream-user.vim" [cream-autocmd.vim] (VimEnter event) 6. Cream_conf_override() [cream-autocmd.vim] (BufEnter event) This is called *with every buffer switch*. Then this paragraph may be left out: >> > 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. >My struggle with the FAQ is to try and >explain this simply while still giving a developer the opportunity to >really understand what is going on without reading the code. (Perhaps >that's not possible?) Of course this answer isn't for the absolute beginner, who doesn't know = much about Vim, Vim scripts and Autocommands. Because there is so little documentation the FAQ's answer should be correct and complete. --=20 Kai Borgolte, Bonn |