diff --git a/README.md b/README.md index e47268952..51a56205f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,36 @@ Like spacemacs, but for vim. - [init.vim](./init.vim) - Sources `config/main.vim` - [vimrc](./vimrc) - Sources `config/main.vim` +## Modular configuration + +SpaceVim will load custom configuration from `./.local.vim`, here is an example: +```viml +" here are some basic customizations, please refer to the top of the vimrc file for all possible options +let g:settings.default_indent = 3 +let g:settings.max_column = 80 +let g:settings.colorscheme = 'my_awesome_colorscheme' +let g:settings.plugin_manager = 'dein' " neobundle or dein or vim-plug + +" change the default directory where all miscellaneous persistent files go +let g:settings.cache_dir = "/some/place/else" + +" by default, language specific plugins are not loaded. this can be changed with the following: +let g:settings.plugin_groups_exclude = ['ruby', 'python'] + +" if there are groups you want always loaded, you can use this: +let g:settings.plugin_groups_include = ['go'] + +" alternatively, you can set this variable to load exactly what you want +let g:settings.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:settings.disabled_plugins=['vim-foo', 'vim-bar'] + +" anything defined here are simply overrides +set wildignore+=\*/node_modules/\* +set guifont=Wingdings:h10 +``` + ## Plugin Highlights - Package management with caching enabled and lazy loading diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim new file mode 100644 index 000000000..9be753983 --- /dev/null +++ b/autoload/SpaceVim.vim @@ -0,0 +1,18 @@ +function! SpaceVim#init() abort + +endfunction + +function! SpaceVim#loadCustomConfig() abort + let custom_confs = globpath(getcwd(), '.local.vim', 1,1) + if !empty(custom_confs) + exe 'source ' . custom_confs[0] + endif +endfunction + +function! SpaceVim#Layer(layer, opt) abort + +endfunction + +function! SpaceVim#end() abort + +endfunction diff --git a/config/main.vim b/config/main.vim index 37beeda3a..6fddd5042 100644 --- a/config/main.vim +++ b/config/main.vim @@ -2,15 +2,18 @@ let g:Config_Main_Home = fnamemodify(expand(''), ':p:h:gs?\\?'.((has('win try call zvim#util#source_rc('functions.vim') catch - execute "set rtp +=" . fnamemodify(g:Config_Main_Home, ':p:h:h') + execute 'set rtp +=' . fnamemodify(g:Config_Main_Home, ':p:h:h') call zvim#util#source_rc('functions.vim') endtry +call SpaceVim#init() + call zvim#util#source_rc('init.vim') -scriptencoding utf-8 -call zvim#util#source_rc('local.vim') +call SpaceVim#loadCustomConfig() + +call SpaceVim#end() call zvim#util#source_rc('plugins.vim')