aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin/rplugin.vim
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2016-03-02 05:06:36 +0900
committerJustin M. Keyes <justinkz@gmail.com>2016-03-10 10:34:57 -0500
commitbb020df0f52c3eec6cb84ce1a786fa3a90904815 (patch)
tree8200a9af36101fe23085e90b683bf090627512e5 /runtime/plugin/rplugin.vim
parente7485ab1c969bb4077db42be92473a8923bb1e08 (diff)
downloadrneovim-bb020df0f52c3eec6cb84ce1a786fa3a90904815.tar.gz
rneovim-bb020df0f52c3eec6cb84ce1a786fa3a90904815.tar.bz2
rneovim-bb020df0f52c3eec6cb84ce1a786fa3a90904815.zip
rplugin: Initialize remote plugins lazily. #4384
Diffstat (limited to 'runtime/plugin/rplugin.vim')
-rw-r--r--runtime/plugin/rplugin.vim15
1 files changed, 13 insertions, 2 deletions
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('<amatch>'))
+ autocmd CmdUndefined *
+ \ call remote#host#LoadRemotePluginsEvent(
+ \ 'CmdUndefined', expand('<amatch>'))
+augroup END