From 26b7c1e45a3086eb5a5488ed8555d97260fa9082 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 3 Jul 2024 07:38:50 +0800 Subject: [PATCH] perf(plugins): lazy load plugins --- autoload/SpaceVim/layers/core.vim | 2 +- autoload/SpaceVim/layers/github.vim | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/layers/core.vim b/autoload/SpaceVim/layers/core.vim index 87142c714..027eb08bd 100644 --- a/autoload/SpaceVim/layers/core.vim +++ b/autoload/SpaceVim/layers/core.vim @@ -224,7 +224,7 @@ function! SpaceVim#layers#core#plugins() abort xmap T (clever-f-T) omap T (clever-f-T) endif - call add(plugins, [g:_spacevim_root_dir . 'bundle/nerdcommenter', { 'loadconf' : 1, 'merged' : 0}]) + call add(plugins, [g:_spacevim_root_dir . 'bundle/nerdcommenter', { 'loadconf' : 1, 'merged' : 0, 'on_map' : ['NERDCommenter', 'Commenter']}]) if exists('*matchaddpos') call add(plugins, [g:_spacevim_root_dir . 'bundle/vim-matchup', {'merged' : 0, 'on_event' : 'BufReadPost'}]) diff --git a/autoload/SpaceVim/layers/github.vim b/autoload/SpaceVim/layers/github.vim index 08be8502f..0f0ce4c8b 100644 --- a/autoload/SpaceVim/layers/github.vim +++ b/autoload/SpaceVim/layers/github.vim @@ -39,13 +39,14 @@ function! SpaceVim#layers#github#plugins() abort \ [g:_spacevim_root_dir . 'bundle/vim-github-dashboard', { \ 'merged' : 0, \ 'if' : has('ruby'), + \ 'on_cmd' : ['GHActivity', 'GHDashboard'], \ }], \ ['tyru/open-browser-github.vim', { \ 'depends': 'open-browser.vim', \ 'on_cmd': ['OpenGithubFile', 'OpenGithubIssue', 'OpenGithubPullReq'], \ }], \ [g:_spacevim_root_dir . 'bundle/github.vim', {'merged' : 0}], - \ ['lambdalisue/vim-gista', {'merged' : 0}], + \ ['lambdalisue/vim-gista', {'merged' : 0, 'on_cmd' : ['Gista']}], \ ] endfunction