aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin/rplugin.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/plugin/rplugin.vim')
-rw-r--r--runtime/plugin/rplugin.vim17
1 files changed, 14 insertions, 3 deletions
diff --git a/runtime/plugin/rplugin.vim b/runtime/plugin/rplugin.vim
index 2b2d333738..b4b03032b3 100644
--- a/runtime/plugin/rplugin.vim
+++ b/runtime/plugin/rplugin.vim
@@ -1,5 +1,16 @@
-if exists('loaded_remote_plugins') || &cp
+if exists('g:loaded_remote_plugins')
finish
endif
-let loaded_remote_plugins = 1
-call remote#host#LoadRemotePlugins()
+let g:loaded_remote_plugins = 1
+
+command! UpdateRemotePlugins call remote#host#UpdateRemotePlugins()
+
+augroup nvim-rplugin
+ autocmd!
+ autocmd FuncUndefined *
+ \ call remote#host#LoadRemotePluginsEvent(
+ \ 'FuncUndefined', expand('<amatch>'))
+ autocmd CmdUndefined *
+ \ call remote#host#LoadRemotePluginsEvent(
+ \ 'CmdUndefined', expand('<amatch>'))
+augroup END