From bb020df0f52c3eec6cb84ce1a786fa3a90904815 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Wed, 2 Mar 2016 05:06:36 +0900 Subject: rplugin: Initialize remote plugins lazily. #4384 --- runtime/plugin/rplugin.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/rplugin.vim b/runtime/plugin/rplugin.vim index 879775ff0e..b4b03032b3 100644 --- a/runtime/plugin/rplugin.vim +++ b/runtime/plugin/rplugin.vim @@ -1,5 +1,16 @@ -if exists('g:loaded_remote_plugins') || &cp +if exists('g:loaded_remote_plugins') finish endif let g:loaded_remote_plugins = 1 -call remote#host#LoadRemotePlugins() + +command! UpdateRemotePlugins call remote#host#UpdateRemotePlugins() + +augroup nvim-rplugin + autocmd! + autocmd FuncUndefined * + \ call remote#host#LoadRemotePluginsEvent( + \ 'FuncUndefined', expand('')) + autocmd CmdUndefined * + \ call remote#host#LoadRemotePluginsEvent( + \ 'CmdUndefined', expand('')) +augroup END -- cgit