On 2019-05-30, Paul Jolly wrote:

> So I'd like to explore a pattern by which the end user calls a config
> function from their .vimrc or whenever they want to change a config
> value. This will have the benefit of pushing the config value to the
> channel-based plugin, but also allowing tighter validation at the time
> of the value being set.
> 
> The main problem (aside from my complete lack of real understanding of
> the .vimrc load sequence) is that plugins have not loaded at the time
> .vimrc is processed, and hence it's not possible to call a
> plugin-defined config function directly... so we'd need to handle this
> somehow.
> 
> Does anyone have any thoughts on/experience of the above?

If you really want to load a plugin so that its functions are
accessible from your vimrc, then put a :source or :runtime command
in your vimrc before you call those functions, e.g.,

    :runtime! my_early_plugin.vim
    :MyEarlyPluginCommand arg1 arg2

Note that :runtime searches your 'runtimepath' for the specified
file, so in the example above, you would put my_early_plugin.vim in
your ~/.vim directory, not in your ~/.vim/plugin directory.

Regards,
Gary

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20190530174609.GC15304%40phoenix.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui