Saturday, September 4, 2010

Re: Determine whether vim is loading or whether the VimEnter event was already fired

Excerpts from Tom Link's message of Sat Sep 04 08:23:18 +0200 2010:
> Hi,
>
> Is there a general/standard way to determine whether vim is loading
> (before VimEnter) or whether the startup was already completed?
> Something like v:loading (similar to v:dying) maybe? I.e. how could I
> distinguish whether a script/plugin is loaded during startup or by
> means of a :source or :runtime command?

" hack: Vim sources plugin files after sourcing .vimrc
" Vim doesn't source the after/plugin/*.vim files in other runtime
" paths. So do this *after* plugin/* files have been sourced
fun! scriptmanager#Hack()
let s:c['started_up'] = 1

That's called by VimEnter in vim-addon-manager.

What's your exact use case, Tom?

If you want to depend on vim-addon-manager you can check for
g:vim_script_manager['started_up']

Or implement something similar yourself.

Marc Weber

--
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

No comments: