From 418eefafc8aa3913a0113064c53569405e126263 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 9 Jan 2017 22:50:06 +0800 Subject: [PATCH] Add option for custom plugins --- README.md | 5 +++++ autoload/SpaceVim.vim | 9 +++++++++ autoload/SpaceVim/plugins.vim | 7 +++++++ doc/SpaceVim.txt | 9 +++++++++ 4 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 925834e60..f02c88609 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,11 @@ let g:spacevim_plugin_groups = ['core', 'web'] " if there is a particular plugin you don't like, you can define this variable to disable them entirely let g:spacevim_disabled_plugins=['vim-foo', 'vim-bar'] +" if you want to add some custom plugins, use this options. +let g:spacevim_custom_plugins = [ + \ ['plasticboy/vim-markdown', 'on_ft' : 'markdown'], + \ ['wsdjeg/GitHub.vim'], + \ ] " anything defined here are simply overrides set wildignore+=\*/node_modules/\* diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index e762e5d3d..e31d0b245 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -111,6 +111,15 @@ let g:spacevim_plugin_groups = [] " < let g:spacevim_disabled_plugins = [] "" +" Add custom plugins +" > +" let g:spacevim_custom_plugins = [ +" \ ['plasticboy/vim-markdown', 'on_ft' : 'markdown'], +" \ ['wsdjeg/GitHub.vim'], +" \ ] +" < +let g:spacevim_custom_plugins = [] +"" " enable/disable SpaceVim with powerline symbols. let g:spacevim_enable_powerline_fonts = 1 "" diff --git a/autoload/SpaceVim/plugins.vim b/autoload/SpaceVim/plugins.vim index 521dcb8bd..b0a05d9b5 100644 --- a/autoload/SpaceVim/plugins.vim +++ b/autoload/SpaceVim/plugins.vim @@ -428,6 +428,13 @@ function! s:load_plugins() abort endif endfor endfor + for plugin in g:spacevim_custom_plugins + if len(plugin) == 2 + call zvim#plug#add(plugin[0], plugin[1]) + else + call zvim#plug#add(plugin[0]) + endif + endfor endfunction function! s:disable_plugins(plugin_list) abort diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 97b9c5b5b..8aee011d6 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -108,6 +108,15 @@ Disable plugins by names. example: let g:spacevim_disabled_plugins = ['vim-foo', 'vim-bar'] < + *g:spacevim_custom_plugins* +Add custom plugins +> + let g:spacevim_custom_plugins = [ + \ ['plasticboy/vim-markdown', 'on_ft' : 'markdown'], + \ ['wsdjeg/GitHub.vim'], + \ ] +< + *g:spacevim_enable_powerline_fonts* enable/disable SpaceVim with powerline symbols.