mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 02:50:06 +08:00
Use g:spacevim_* as options
issue opened here: https://github.com/google/vimdoc/issues/94
This commit is contained in:
parent
d3dc775a04
commit
56516afc86
18
README.md
18
README.md
@ -53,25 +53,25 @@ SpaceVim will load custom configuration from `~/.local.vim` and `.local.vim` in
|
|||||||
here is an example:
|
here is an example:
|
||||||
```viml
|
```viml
|
||||||
" here are some basic customizations, please refer to the top of the vimrc file for all possible options
|
" 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:spacevim_default_indent = 3
|
||||||
let g:settings.max_column = 80
|
let g:spacevim_max_column = 80
|
||||||
let g:settings.colorscheme = 'my_awesome_colorscheme'
|
let g:spacevim_colorscheme = 'my_awesome_colorscheme'
|
||||||
let g:settings.plugin_manager = 'dein' " neobundle or dein or vim-plug
|
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
|
||||||
|
|
||||||
" change the default directory where all miscellaneous persistent files go
|
" change the default directory where all miscellaneous persistent files go
|
||||||
let g:settings.cache_dir = "/some/place/else"
|
let g:spacevim_cache_dir = "/some/place/else"
|
||||||
|
|
||||||
" by default, language specific plugins are not loaded. this can be changed with the following:
|
" by default, language specific plugins are not loaded. this can be changed with the following:
|
||||||
let g:settings.plugin_groups_exclude = ['ruby', 'python']
|
let g:spacevim_plugin_groups_exclude = ['ruby', 'python']
|
||||||
|
|
||||||
" if there are groups you want always loaded, you can use this:
|
" if there are groups you want always loaded, you can use this:
|
||||||
let g:settings.plugin_groups_include = ['go']
|
let g:spacevim_plugin_groups_include = ['go']
|
||||||
|
|
||||||
" alternatively, you can set this variable to load exactly what you want
|
" alternatively, you can set this variable to load exactly what you want
|
||||||
let g:settings.plugin_groups = ['core', 'web']
|
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
|
" 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']
|
let g:spacevim_disabled_plugins=['vim-foo', 'vim-bar']
|
||||||
|
|
||||||
" anything defined here are simply overrides
|
" anything defined here are simply overrides
|
||||||
set wildignore+=\*/node_modules/\*
|
set wildignore+=\*/node_modules/\*
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
function! SpaceVim#init() abort
|
function! SpaceVim#init() abort
|
||||||
"Vim settings
|
"Vim settings
|
||||||
let g:settings = get(g:, 'settings', {})
|
let g:spacevim_ = get(g:, 'settings', {})
|
||||||
""
|
""
|
||||||
" The default_indent of SpaceVim.
|
" The default_indent of SpaceVim.
|
||||||
let g:settings.default_indent = 2
|
let g:spacevim_default_indent = 2
|
||||||
let g:settings.max_column = 120
|
let g:spacevim_max_column = 120
|
||||||
let g:settings.enable_googlesuggest = 0
|
let g:spacevim_enable_googlesuggest = 0
|
||||||
let g:settings.auto_download_neobundle = 0
|
let g:spacevim_auto_download_neobundle = 0
|
||||||
let g:settings.neobundle_installed = 0
|
let g:spacevim_neobundle_installed = 0
|
||||||
let g:settings.dein_installed = 0
|
let g:spacevim_dein_installed = 0
|
||||||
let g:settings.vim_plug_installed = 0
|
let g:spacevim_vim_plug_installed = 0
|
||||||
let g:settings.plugin_bundle_dir = $HOME. join(['', '.cache', 'vimfiles', ''], '/')
|
let g:spacevim_plugin_bundle_dir = $HOME. join(['', '.cache', 'vimfiles', ''], '/')
|
||||||
let g:settings.autocomplete_method = ''
|
let g:spacevim_autocomplete_method = ''
|
||||||
let g:settings.enable_cursorcolumn = 0
|
let g:spacevim_enable_cursorcolumn = 0
|
||||||
let g:settings.enable_neomake = 1
|
let g:spacevim_enable_neomake = 1
|
||||||
let g:settings.enable_ycm = 0
|
let g:spacevim_enable_ycm = 0
|
||||||
let g:settings.enable_neocomplcache = 0
|
let g:spacevim_enable_neocomplcache = 0
|
||||||
let g:settings.enable_cursorline = 0
|
let g:spacevim_enable_cursorline = 0
|
||||||
let g:settings.error_symbol = '✖'
|
let g:spacevim_error_symbol = '✖'
|
||||||
let g:settings.warning_symbol = '⚠'
|
let g:spacevim_warning_symbol = '⚠'
|
||||||
let g:settings.use_colorscheme = 1
|
let g:spacevim_use_colorscheme = 1
|
||||||
let g:settings.vim_help_language = 'en'
|
let g:spacevim_vim_help_language = 'en'
|
||||||
let g:settings.colorscheme = 'gruvbox'
|
let g:spacevim_colorscheme = 'gruvbox'
|
||||||
let g:settings.colorscheme_default = 'desert'
|
let g:spacevim_colorscheme_default = 'desert'
|
||||||
let g:settings.filemanager = 'vimfiler'
|
let g:spacevim_filemanager = 'vimfiler'
|
||||||
let g:settings.plugin_manager = 'dein' " neobundle or dein or vim-plug
|
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
|
||||||
let g:settings.checkinstall = 0
|
let g:spacevim_checkinstall = 0
|
||||||
let g:settings.hiddenfileinfo = 1
|
let g:spacevim_hiddenfileinfo = 1
|
||||||
let g:settings.plugin_groups_exclude = []
|
let g:spacevim_plugin_groups_exclude = []
|
||||||
let g:settings.plugin_groups = []
|
let g:spacevim_plugin_groups = []
|
||||||
let g:settings.smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
|
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
|
||||||
let g:settings.smartcloseignoreft = ['help']
|
let g:spacevim_smartcloseignoreft = ['help']
|
||||||
let g:settings.altmoveignoreft = ['Tagbar' , 'vimfiler']
|
let g:spacevim_altmoveignoreft = ['Tagbar' , 'vimfiler']
|
||||||
let g:settings.enable_javacomplete2_py = 0
|
let g:spacevim_enable_javacomplete2_py = 0
|
||||||
let g:settings.src_root = 'E:\sources\'
|
let g:spacevim_src_root = 'E:\sources\'
|
||||||
let g:settings.hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
|
let g:spacevim_hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
|
||||||
let g:settings.wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,
|
let g:spacevim_wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,
|
||||||
\*.ttf,*.TTF,*.png,*/target/*,
|
\*.ttf,*.TTF,*.png,*/target/*,
|
||||||
\.git,.svn,.hg,.DS_Store'
|
\.git,.svn,.hg,.DS_Store'
|
||||||
|
|
||||||
@ -60,70 +60,70 @@ function! SpaceVim#Layer(layer, opt) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#end() abort
|
function! SpaceVim#end() abort
|
||||||
for s:group in g:settings.plugin_groups_exclude
|
for s:group in g:spacevim_plugin_groups_exclude
|
||||||
let s:i = index(g:settings.plugin_groups, s:group)
|
let s:i = index(g:spacevim_plugin_groups, s:group)
|
||||||
if s:i != -1
|
if s:i != -1
|
||||||
call remove(g:settings.plugin_groups, s:i)
|
call remove(g:spacevim_plugin_groups, s:i)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
if g:settings.vim_help_language ==# 'cn'
|
if g:spacevim_vim_help_language ==# 'cn'
|
||||||
call add(g:settings.plugin_groups, 'chinese')
|
call add(g:spacevim_plugin_groups, 'chinese')
|
||||||
endif
|
endif
|
||||||
if g:settings.use_colorscheme==1
|
if g:spacevim_use_colorscheme==1
|
||||||
call add(g:settings.plugin_groups, 'colorscheme')
|
call add(g:spacevim_plugin_groups, 'colorscheme')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
let g:settings.autocomplete_method = 'deoplete'
|
let g:spacevim_autocomplete_method = 'deoplete'
|
||||||
elseif has('lua')
|
elseif has('lua')
|
||||||
let g:settings.autocomplete_method = 'neocomplete'
|
let g:spacevim_autocomplete_method = 'neocomplete'
|
||||||
else
|
else
|
||||||
let g:settings.autocomplete_method = 'neocomplcache'
|
let g:spacevim_autocomplete_method = 'neocomplcache'
|
||||||
endif
|
endif
|
||||||
if g:settings.enable_ycm
|
if g:spacevim_enable_ycm
|
||||||
let g:settings.autocomplete_method = 'ycm'
|
let g:spacevim_autocomplete_method = 'ycm'
|
||||||
endif
|
endif
|
||||||
if g:settings.enable_neocomplcache
|
if g:spacevim_enable_neocomplcache
|
||||||
let g:settings.autocomplete_method = 'neocomplcache'
|
let g:spacevim_autocomplete_method = 'neocomplcache'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! SpaceVim#default() abort
|
function! SpaceVim#default() abort
|
||||||
call add(g:settings.plugin_groups, 'web')
|
call add(g:spacevim_plugin_groups, 'web')
|
||||||
call add(g:settings.plugin_groups, 'lang')
|
call add(g:spacevim_plugin_groups, 'lang')
|
||||||
call add(g:settings.plugin_groups, 'javascript')
|
call add(g:spacevim_plugin_groups, 'javascript')
|
||||||
call add(g:settings.plugin_groups, 'ruby')
|
call add(g:spacevim_plugin_groups, 'ruby')
|
||||||
call add(g:settings.plugin_groups, 'python')
|
call add(g:spacevim_plugin_groups, 'python')
|
||||||
call add(g:settings.plugin_groups, 'scala')
|
call add(g:spacevim_plugin_groups, 'scala')
|
||||||
call add(g:settings.plugin_groups, 'go')
|
call add(g:spacevim_plugin_groups, 'go')
|
||||||
call add(g:settings.plugin_groups, 'scm')
|
call add(g:spacevim_plugin_groups, 'scm')
|
||||||
call add(g:settings.plugin_groups, 'editing')
|
call add(g:spacevim_plugin_groups, 'editing')
|
||||||
call add(g:settings.plugin_groups, 'indents')
|
call add(g:spacevim_plugin_groups, 'indents')
|
||||||
call add(g:settings.plugin_groups, 'navigation')
|
call add(g:spacevim_plugin_groups, 'navigation')
|
||||||
call add(g:settings.plugin_groups, 'misc')
|
call add(g:spacevim_plugin_groups, 'misc')
|
||||||
|
|
||||||
call add(g:settings.plugin_groups, 'core')
|
call add(g:spacevim_plugin_groups, 'core')
|
||||||
call add(g:settings.plugin_groups, 'unite')
|
call add(g:spacevim_plugin_groups, 'unite')
|
||||||
call add(g:settings.plugin_groups, 'github')
|
call add(g:spacevim_plugin_groups, 'github')
|
||||||
if has('python3')
|
if has('python3')
|
||||||
call add(g:settings.plugin_groups, 'denite')
|
call add(g:spacevim_plugin_groups, 'denite')
|
||||||
endif
|
endif
|
||||||
call add(g:settings.plugin_groups, 'ctrlp')
|
call add(g:spacevim_plugin_groups, 'ctrlp')
|
||||||
call add(g:settings.plugin_groups, 'autocomplete')
|
call add(g:spacevim_plugin_groups, 'autocomplete')
|
||||||
if ! has('nvim')
|
if ! has('nvim')
|
||||||
call add(g:settings.plugin_groups, 'vim')
|
call add(g:spacevim_plugin_groups, 'vim')
|
||||||
else
|
else
|
||||||
call add(g:settings.plugin_groups, 'nvim')
|
call add(g:spacevim_plugin_groups, 'nvim')
|
||||||
endif
|
endif
|
||||||
if OSX()
|
if OSX()
|
||||||
call add(g:settings.plugin_groups, 'osx')
|
call add(g:spacevim_plugin_groups, 'osx')
|
||||||
endif
|
endif
|
||||||
if WINDOWS()
|
if WINDOWS()
|
||||||
call add(g:settings.plugin_groups, 'windows')
|
call add(g:spacevim_plugin_groups, 'windows')
|
||||||
endif
|
endif
|
||||||
if LINUX()
|
if LINUX()
|
||||||
call add(g:settings.plugin_groups, 'linux')
|
call add(g:spacevim_plugin_groups, 'linux')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -10,20 +10,20 @@ function! s:install_manager()
|
|||||||
let s:Fsep = '/'
|
let s:Fsep = '/'
|
||||||
endif
|
endif
|
||||||
" auto install plugin manager
|
" auto install plugin manager
|
||||||
if g:settings.plugin_manager ==# 'neobundle'
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
"auto install neobundle
|
"auto install neobundle
|
||||||
if filereadable(expand(g:settings.plugin_bundle_dir)
|
if filereadable(expand(g:spacevim_plugin_bundle_dir)
|
||||||
\ . 'neobundle.vim'. s:Fsep. 'README.md')
|
\ . 'neobundle.vim'. s:Fsep. 'README.md')
|
||||||
let g:settings.neobundle_installed = 1
|
let g:spacevim_neobundle_installed = 1
|
||||||
else
|
else
|
||||||
if executable('git')
|
if executable('git')
|
||||||
exec '!git clone '
|
exec '!git clone '
|
||||||
\ .'https://github.com/'
|
\ .'https://github.com/'
|
||||||
\ .'Shougo/neobundle.vim'
|
\ .'Shougo/neobundle.vim'
|
||||||
\ . ' '
|
\ . ' '
|
||||||
\ . g:settings.plugin_bundle_dir
|
\ . g:spacevim_plugin_bundle_dir
|
||||||
\ . 'neobundle.vim'
|
\ . 'neobundle.vim'
|
||||||
let g:settings.neobundle_installed = 1
|
let g:spacevim_neobundle_installed = 1
|
||||||
else
|
else
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echom "You need install git!"
|
echom "You need install git!"
|
||||||
@ -31,35 +31,35 @@ function! s:install_manager()
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
exec 'set runtimepath+='
|
exec 'set runtimepath+='
|
||||||
\ . g:settings.plugin_bundle_dir
|
\ . g:spacevim_plugin_bundle_dir
|
||||||
\ . 'neobundle.vim'
|
\ . 'neobundle.vim'
|
||||||
elseif g:settings.plugin_manager == 'dein'
|
elseif g:spacevim_plugin_manager == 'dein'
|
||||||
"auto install dein
|
"auto install dein
|
||||||
if filereadable(expand(g:settings.plugin_bundle_dir)
|
if filereadable(expand(g:spacevim_plugin_bundle_dir)
|
||||||
\ . join(['repos', 'github.com',
|
\ . join(['repos', 'github.com',
|
||||||
\ 'Shougo', 'dein.vim', 'README.md'],
|
\ 'Shougo', 'dein.vim', 'README.md'],
|
||||||
\ s:Fsep))
|
\ s:Fsep))
|
||||||
let g:settings.dein_installed = 1
|
let g:spacevim_dein_installed = 1
|
||||||
else
|
else
|
||||||
if executable('git')
|
if executable('git')
|
||||||
exec '!git clone https://github.com/Shougo/dein.vim '
|
exec '!git clone https://github.com/Shougo/dein.vim '
|
||||||
\ . g:settings.plugin_bundle_dir
|
\ . g:spacevim_plugin_bundle_dir
|
||||||
\ . join(['repos', 'github.com',
|
\ . join(['repos', 'github.com',
|
||||||
\ 'Shougo', 'dein.vim'], s:Fsep)
|
\ 'Shougo', 'dein.vim'], s:Fsep)
|
||||||
let g:settings.dein_installed = 1
|
let g:spacevim_dein_installed = 1
|
||||||
else
|
else
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echom "You need install git!"
|
echom "You need install git!"
|
||||||
echohl None
|
echohl None
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
exec 'set runtimepath+='.g:settings.plugin_bundle_dir
|
exec 'set runtimepath+='.g:spacevim_plugin_bundle_dir
|
||||||
\ . join(['repos', 'github.com', 'Shougo',
|
\ . join(['repos', 'github.com', 'Shougo',
|
||||||
\ 'dein.vim'], s:Fsep)
|
\ 'dein.vim'], s:Fsep)
|
||||||
elseif g:settings.plugin_manager == 'vim-plug'
|
elseif g:spacevim_plugin_manager == 'vim-plug'
|
||||||
"auto install vim-plug
|
"auto install vim-plug
|
||||||
if filereadable(expand('~/.cache/vim-plug/autoload/plug.vim'))
|
if filereadable(expand('~/.cache/vim-plug/autoload/plug.vim'))
|
||||||
let g:settings.dein_installed = 1
|
let g:spacevim_dein_installed = 1
|
||||||
else
|
else
|
||||||
if executable('curl')
|
if executable('curl')
|
||||||
exec '!curl -fLo '
|
exec '!curl -fLo '
|
||||||
@ -67,7 +67,7 @@ function! s:install_manager()
|
|||||||
\ . ' --create-dirs '
|
\ . ' --create-dirs '
|
||||||
\ . 'https://raw.githubusercontent.com/'
|
\ . 'https://raw.githubusercontent.com/'
|
||||||
\ . 'junegunn/vim-plug/master/plug.vim'
|
\ . 'junegunn/vim-plug/master/plug.vim'
|
||||||
let g:settings.dein_installed = 1
|
let g:spacevim_dein_installed = 1
|
||||||
else
|
else
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echom "You need install curl!"
|
echom "You need install curl!"
|
||||||
@ -78,7 +78,7 @@ function! s:install_manager()
|
|||||||
endif
|
endif
|
||||||
endf
|
endf
|
||||||
|
|
||||||
if get(g:settings, 'enable_plugins', 1)
|
if get(g:,'spacevim_enable_plugins', 1)
|
||||||
call s:install_manager()
|
call s:install_manager()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -90,41 +90,41 @@ function! zvim#plug#begin(path) abort
|
|||||||
let g:unite_source_menu_menus.AddedPlugins.command_candidates = []
|
let g:unite_source_menu_menus.AddedPlugins.command_candidates = []
|
||||||
nnoremap <silent><Leader>lp :Unite -silent
|
nnoremap <silent><Leader>lp :Unite -silent
|
||||||
\ -winheight=17 -start-insert menu:AddedPlugins<CR>
|
\ -winheight=17 -start-insert menu:AddedPlugins<CR>
|
||||||
if g:settings.plugin_manager == 'neobundle'
|
if g:spacevim_plugin_manager == 'neobundle'
|
||||||
call neobundle#begin(a:path)
|
call neobundle#begin(a:path)
|
||||||
elseif g:settings.plugin_manager == 'dein'
|
elseif g:spacevim_plugin_manager == 'dein'
|
||||||
call dein#begin(a:path)
|
call dein#begin(a:path)
|
||||||
elseif g:settings.plugin_manager == 'vim-plug'
|
elseif g:spacevim_plugin_manager == 'vim-plug'
|
||||||
call plug#begin(a:path)
|
call plug#begin(a:path)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zvim#plug#end() abort
|
function! zvim#plug#end() abort
|
||||||
if g:settings.plugin_manager == 'neobundle'
|
if g:spacevim_plugin_manager == 'neobundle'
|
||||||
call neobundle#end()
|
call neobundle#end()
|
||||||
if g:settings.checkinstall == 1
|
if g:spacevim_checkinstall == 1
|
||||||
NeoBundleCheck
|
NeoBundleCheck
|
||||||
endif
|
endif
|
||||||
elseif g:settings.plugin_manager == 'dein'
|
elseif g:spacevim_plugin_manager == 'dein'
|
||||||
call dein#end()
|
call dein#end()
|
||||||
if g:settings.checkinstall == 1
|
if g:spacevim_checkinstall == 1
|
||||||
if dein#check_install()
|
if dein#check_install()
|
||||||
call dein#install()
|
call dein#install()
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
call dein#call_hook('source')
|
call dein#call_hook('source')
|
||||||
elseif g:settings.plugin_manager == 'vim-plug'
|
elseif g:spacevim_plugin_manager == 'vim-plug'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zvim#plug#defind_hooks(bundle) abort
|
function! zvim#plug#defind_hooks(bundle) abort
|
||||||
if g:settings.plugin_manager == 'neobundle'
|
if g:spacevim_plugin_manager == 'neobundle'
|
||||||
let s:hooks = neobundle#get_hooks(a:bundle)
|
let s:hooks = neobundle#get_hooks(a:bundle)
|
||||||
func! s:hooks.on_source(bundle) abort
|
func! s:hooks.on_source(bundle) abort
|
||||||
call zvim#util#source_rc('plugins/' . split(a:bundle['name'],'\.')[0] . '.vim')
|
call zvim#util#source_rc('plugins/' . split(a:bundle['name'],'\.')[0] . '.vim')
|
||||||
endf
|
endf
|
||||||
elseif g:settings.plugin_manager == 'dein'
|
elseif g:spacevim_plugin_manager == 'dein'
|
||||||
call dein#config(g:dein#name, {
|
call dein#config(g:dein#name, {
|
||||||
\ 'hook_source' : "call zvim#util#source_rc('plugins/" . split(g:dein#name,'\.')[0] . ".vim')"
|
\ 'hook_source' : "call zvim#util#source_rc('plugins/" . split(g:dein#name,'\.')[0] . ".vim')"
|
||||||
\ })
|
\ })
|
||||||
@ -132,9 +132,9 @@ function! zvim#plug#defind_hooks(bundle) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zvim#plug#fetch() abort
|
function! zvim#plug#fetch() abort
|
||||||
if g:settings.plugin_manager == 'neobundle'
|
if g:spacevim_plugin_manager == 'neobundle'
|
||||||
NeoBundleFetch 'Shougo/neobundle.vim'
|
NeoBundleFetch 'Shougo/neobundle.vim'
|
||||||
elseif g:settings.plugin_manager == 'dein'
|
elseif g:spacevim_plugin_manager == 'dein'
|
||||||
call dein#add('Shougo/dein.vim')
|
call dein#add('Shougo/dein.vim')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
@ -146,9 +146,9 @@ fu! s:parser(args)
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
function! zvim#plug#add(repo,...) abort
|
function! zvim#plug#add(repo,...) abort
|
||||||
if g:settings.plugin_manager == 'neobundle'
|
if g:spacevim_plugin_manager == 'neobundle'
|
||||||
exec 'NeoBundle "'.a:repo.'"'.','.join(a:000,',')
|
exec 'NeoBundle "'.a:repo.'"'.','.join(a:000,',')
|
||||||
elseif g:settings.plugin_manager == 'dein'
|
elseif g:spacevim_plugin_manager == 'dein'
|
||||||
if len(a:000) > 0
|
if len(a:000) > 0
|
||||||
call dein#add(a:repo,s:parser(a:000[0]))
|
call dein#add(a:repo,s:parser(a:000[0]))
|
||||||
else
|
else
|
||||||
@ -168,17 +168,17 @@ function! zvim#plug#add(repo,...) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zvim#plug#tap(plugin) abort
|
function! zvim#plug#tap(plugin) abort
|
||||||
if g:settings.plugin_manager == 'neobundle'
|
if g:spacevim_plugin_manager == 'neobundle'
|
||||||
return neobundle#tap(a:plugin)
|
return neobundle#tap(a:plugin)
|
||||||
elseif g:settings.plugin_manager == 'dein'
|
elseif g:spacevim_plugin_manager == 'dein'
|
||||||
return dein#tap(a:plugin)
|
return dein#tap(a:plugin)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zvim#plug#enable_plug() abort
|
function! zvim#plug#enable_plug() abort
|
||||||
return g:settings.neobundle_installed
|
return g:spacevim_neobundle_installed
|
||||||
\ || g:settings.dein_installed
|
\ || g:spacevim_dein_installed
|
||||||
\ || g:settings.vim_plug_installed
|
\ || g:spacevim_vim_plug_installed
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
|
@ -88,7 +88,7 @@ set autowrite
|
|||||||
set hlsearch
|
set hlsearch
|
||||||
set laststatus=2
|
set laststatus=2
|
||||||
set completeopt=longest,menu
|
set completeopt=longest,menu
|
||||||
exe "set wildignore+=" . g:settings.wildignore
|
exe "set wildignore+=" . g:spacevim_wildignore
|
||||||
set wildignorecase
|
set wildignorecase
|
||||||
let g:markdown_fenced_languages = ['vim', 'java', 'bash=sh', 'sh', 'html', 'python']
|
let g:markdown_fenced_languages = ['vim', 'java', 'bash=sh', 'sh', 'html', 'python']
|
||||||
set mouse=
|
set mouse=
|
||||||
@ -101,21 +101,21 @@ if has('filterpipe')
|
|||||||
endif
|
endif
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
syntax on
|
syntax on
|
||||||
if count(g:settings.plugin_groups, 'colorscheme')&&g:settings.colorscheme!='' "{{{
|
if count(g:spacevim_plugin_groups, 'colorscheme')&&g:spacevim_colorscheme!='' "{{{
|
||||||
set background=dark
|
set background=dark
|
||||||
try
|
try
|
||||||
exec 'colorscheme '. g:settings.colorscheme
|
exec 'colorscheme '. g:spacevim_colorscheme
|
||||||
catch
|
catch
|
||||||
exec 'colorscheme '. g:settings.colorscheme_default
|
exec 'colorscheme '. g:spacevim_colorscheme_default
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
if g:settings.enable_cursorline == 1
|
if g:spacevim_enable_cursorline == 1
|
||||||
set cursorline "显示当前行
|
set cursorline "显示当前行
|
||||||
endif
|
endif
|
||||||
if g:settings.enable_cursorcolumn == 1
|
if g:spacevim_enable_cursorcolumn == 1
|
||||||
set cursorcolumn "显示当前列
|
set cursorcolumn "显示当前列
|
||||||
endif
|
endif
|
||||||
if g:settings.hiddenfileinfo == 1 && has("patch-7.4.1570")
|
if g:spacevim_hiddenfileinfo == 1 && has("patch-7.4.1570")
|
||||||
set shortmess=filnxtToOFs
|
set shortmess=filnxtToOFs
|
||||||
endif
|
endif
|
||||||
if exists('+termguicolors')
|
if exists('+termguicolors')
|
||||||
|
@ -44,7 +44,7 @@ let s:plugins.lang = [
|
|||||||
\ ['isundil/vim-irssi-syntax', { 'on_ft' : 'irssi'}],
|
\ ['isundil/vim-irssi-syntax', { 'on_ft' : 'irssi'}],
|
||||||
\ ['vimperator/vimperator.vim', { 'on_ft' : 'vimperator'}],
|
\ ['vimperator/vimperator.vim', { 'on_ft' : 'vimperator'}],
|
||||||
\ ]
|
\ ]
|
||||||
if g:settings.enable_javacomplete2_py
|
if g:spacevim_enable_javacomplete2_py
|
||||||
call add(s:plugins.lang , ['wsdjeg/vim-javacomplete2', { 'on_ft' : ['java','jsp']}])
|
call add(s:plugins.lang , ['wsdjeg/vim-javacomplete2', { 'on_ft' : ['java','jsp']}])
|
||||||
else
|
else
|
||||||
call add(s:plugins.lang , ['artur-shaik/vim-javacomplete2', { 'on_ft' : ['java','jsp']}])
|
call add(s:plugins.lang , ['artur-shaik/vim-javacomplete2', { 'on_ft' : ['java','jsp']}])
|
||||||
@ -58,10 +58,10 @@ let s:plugins.chat = [
|
|||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
if zvim#plug#enable_plug()
|
if zvim#plug#enable_plug()
|
||||||
call zvim#plug#begin(g:settings.plugin_bundle_dir)
|
call zvim#plug#begin(g:spacevim_plugin_bundle_dir)
|
||||||
call zvim#plug#fetch()
|
call zvim#plug#fetch()
|
||||||
let g:wsd = []
|
let g:wsd = []
|
||||||
for group in g:settings.plugin_groups
|
for group in g:spacevim_plugin_groups
|
||||||
for plugin in get(s:plugins, group, [])
|
for plugin in get(s:plugins, group, [])
|
||||||
if len(plugin) == 2
|
if len(plugin) == 2
|
||||||
call zvim#plug#add(plugin[0], plugin[1])
|
call zvim#plug#add(plugin[0], plugin[1])
|
||||||
@ -73,13 +73,13 @@ if zvim#plug#enable_plug()
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
if count(g:settings.plugin_groups, 'denite')
|
if count(g:spacevim_plugin_groups, 'denite')
|
||||||
call zvim#plug#add('Shougo/denite.nvim',{ 'merged' : 0})
|
call zvim#plug#add('Shougo/denite.nvim',{ 'merged' : 0})
|
||||||
if zvim#plug#tap('denite.nvim')
|
if zvim#plug#tap('denite.nvim')
|
||||||
call zvim#plug#defind_hooks('denite.nvim')
|
call zvim#plug#defind_hooks('denite.nvim')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if count(g:settings.plugin_groups, 'unite') "{{{
|
if count(g:spacevim_plugin_groups, 'unite') "{{{
|
||||||
call zvim#plug#add('Shougo/neoyank.vim')
|
call zvim#plug#add('Shougo/neoyank.vim')
|
||||||
call zvim#plug#add('soh335/unite-qflist')
|
call zvim#plug#add('soh335/unite-qflist')
|
||||||
call zvim#plug#add('ujihisa/unite-equery')
|
call zvim#plug#add('ujihisa/unite-equery')
|
||||||
@ -148,7 +148,7 @@ if zvim#plug#enable_plug()
|
|||||||
call zvim#plug#defind_hooks('vimfiler.vim')
|
call zvim#plug#defind_hooks('vimfiler.vim')
|
||||||
noremap <silent> <F3> :call zvim#util#OpenVimfiler()<CR>
|
noremap <silent> <F3> :call zvim#util#OpenVimfiler()<CR>
|
||||||
endif
|
endif
|
||||||
if g:settings.enable_googlesuggest
|
if g:spacevim_enable_googlesuggest
|
||||||
call zvim#plug#add('mopp/googlesuggest-source.vim')
|
call zvim#plug#add('mopp/googlesuggest-source.vim')
|
||||||
call zvim#plug#add('mattn/googlesuggest-complete-vim')
|
call zvim#plug#add('mattn/googlesuggest-complete-vim')
|
||||||
endif
|
endif
|
||||||
@ -173,7 +173,7 @@ if zvim#plug#enable_plug()
|
|||||||
|
|
||||||
|
|
||||||
"{{{ctrlpvim settings
|
"{{{ctrlpvim settings
|
||||||
if count(g:settings.plugin_groups, 'ctrlp') "{{{
|
if count(g:spacevim_plugin_groups, 'ctrlp') "{{{
|
||||||
call zvim#plug#add('ctrlpvim/ctrlp.vim')
|
call zvim#plug#add('ctrlpvim/ctrlp.vim')
|
||||||
if zvim#plug#tap('ctrlp.vim')
|
if zvim#plug#tap('ctrlp.vim')
|
||||||
call zvim#plug#defind_hooks('ctrlp.vim')
|
call zvim#plug#defind_hooks('ctrlp.vim')
|
||||||
@ -204,7 +204,7 @@ if zvim#plug#enable_plug()
|
|||||||
endif "}}}
|
endif "}}}
|
||||||
|
|
||||||
|
|
||||||
if count(g:settings.plugin_groups, 'autocomplete') "{{{
|
if count(g:spacevim_plugin_groups, 'autocomplete') "{{{
|
||||||
call zvim#plug#add('honza/vim-snippets',{'on_i' : 1})
|
call zvim#plug#add('honza/vim-snippets',{'on_i' : 1})
|
||||||
imap <silent><expr><TAB> zvim#tab()
|
imap <silent><expr><TAB> zvim#tab()
|
||||||
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
|
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
|
||||||
@ -216,7 +216,7 @@ if zvim#plug#enable_plug()
|
|||||||
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
|
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
|
||||||
imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
||||||
smap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
smap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
||||||
if g:settings.autocomplete_method ==# 'ycm' "{{{
|
if g:spacevim_autocomplete_method ==# 'ycm' "{{{
|
||||||
call zvim#plug#add('SirVer/ultisnips')
|
call zvim#plug#add('SirVer/ultisnips')
|
||||||
let g:UltiSnipsExpandTrigger='<tab>'
|
let g:UltiSnipsExpandTrigger='<tab>'
|
||||||
let g:UltiSnipsJumpForwardTrigger='<tab>'
|
let g:UltiSnipsJumpForwardTrigger='<tab>'
|
||||||
@ -250,21 +250,21 @@ if zvim#plug#enable_plug()
|
|||||||
\ 'lua' : ['.', ':'],
|
\ 'lua' : ['.', ':'],
|
||||||
\ 'erlang' : [':'],
|
\ 'erlang' : [':'],
|
||||||
\ }
|
\ }
|
||||||
elseif g:settings.autocomplete_method ==# 'neocomplete' "{{{
|
elseif g:spacevim_autocomplete_method ==# 'neocomplete' "{{{
|
||||||
call zvim#plug#add('Shougo/neocomplete', {
|
call zvim#plug#add('Shougo/neocomplete', {
|
||||||
\ 'on_i' : 1,
|
\ 'on_i' : 1,
|
||||||
\ })
|
\ })
|
||||||
if zvim#plug#tap('neocomplete')
|
if zvim#plug#tap('neocomplete')
|
||||||
call zvim#plug#defind_hooks('neocomplete.vim')
|
call zvim#plug#defind_hooks('neocomplete.vim')
|
||||||
endif
|
endif
|
||||||
elseif g:settings.autocomplete_method ==# 'neocomplcache' "{{{
|
elseif g:spacevim_autocomplete_method ==# 'neocomplcache' "{{{
|
||||||
call zvim#plug#add('Shougo/neocomplcache.vim', {
|
call zvim#plug#add('Shougo/neocomplcache.vim', {
|
||||||
\ 'on_i' : 1,
|
\ 'on_i' : 1,
|
||||||
\ })
|
\ })
|
||||||
if zvim#plug#tap('neocomplcache.vim')
|
if zvim#plug#tap('neocomplcache.vim')
|
||||||
call zvim#plug#defind_hooks('neocomplcache.vim')
|
call zvim#plug#defind_hooks('neocomplcache.vim')
|
||||||
endif
|
endif
|
||||||
elseif g:settings.autocomplete_method ==# 'deoplete'
|
elseif g:spacevim_autocomplete_method ==# 'deoplete'
|
||||||
call zvim#plug#add('Shougo/deoplete.nvim', {
|
call zvim#plug#add('Shougo/deoplete.nvim', {
|
||||||
\ 'on_i' : 1,
|
\ 'on_i' : 1,
|
||||||
\ })
|
\ })
|
||||||
@ -286,7 +286,7 @@ if zvim#plug#enable_plug()
|
|||||||
call zvim#plug#add('Shougo/neopairs.vim', { 'on_i' : 1})
|
call zvim#plug#add('Shougo/neopairs.vim', { 'on_i' : 1})
|
||||||
endif "}}}
|
endif "}}}
|
||||||
|
|
||||||
if count(g:settings.plugin_groups, 'colorscheme') "{{{
|
if count(g:spacevim_plugin_groups, 'colorscheme') "{{{
|
||||||
"colorscheme
|
"colorscheme
|
||||||
call zvim#plug#add('morhetz/gruvbox')
|
call zvim#plug#add('morhetz/gruvbox')
|
||||||
if zvim#plug#tap('gruvbox')
|
if zvim#plug#tap('gruvbox')
|
||||||
@ -301,15 +301,15 @@ if zvim#plug#enable_plug()
|
|||||||
call zvim#plug#add('kristijanhusak/vim-hybrid-material')
|
call zvim#plug#add('kristijanhusak/vim-hybrid-material')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if count(g:settings.plugin_groups, 'chinese') "{{{
|
if count(g:spacevim_plugin_groups, 'chinese') "{{{
|
||||||
call zvim#plug#add('vimcn/vimcdoc')
|
call zvim#plug#add('vimcn/vimcdoc')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if count(g:settings.plugin_groups, 'github') "{{{
|
if count(g:spacevim_plugin_groups, 'github') "{{{
|
||||||
call zvim#plug#add('junegunn/vim-github-dashboard', { 'on_cmd':['GHD','GHA','GHActivity','GHDashboard']})
|
call zvim#plug#add('junegunn/vim-github-dashboard', { 'on_cmd':['GHD','GHA','GHActivity','GHDashboard']})
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if count(g:settings.plugin_groups, 'vim') "{{{
|
if count(g:spacevim_plugin_groups, 'vim') "{{{
|
||||||
call zvim#plug#add('Shougo/vimshell.vim', { 'on_cmd':['VimShell']})
|
call zvim#plug#add('Shougo/vimshell.vim', { 'on_cmd':['VimShell']})
|
||||||
call zvim#plug#add('mattn/vim-terminal', { 'on_cmd':['Terminal']})
|
call zvim#plug#add('mattn/vim-terminal', { 'on_cmd':['Terminal']})
|
||||||
endif
|
endif
|
||||||
@ -352,7 +352,7 @@ if zvim#plug#enable_plug()
|
|||||||
" use this two command to find how long the plugin take!
|
" use this two command to find how long the plugin take!
|
||||||
"profile start vim-javacomplete2.log
|
"profile start vim-javacomplete2.log
|
||||||
"profile! file */vim-javacomplete2/*
|
"profile! file */vim-javacomplete2/*
|
||||||
if g:settings.enable_neomake
|
if g:spacevim_enable_neomake
|
||||||
call zvim#plug#add('neomake/neomake',{'merged' : 0})
|
call zvim#plug#add('neomake/neomake',{'merged' : 0})
|
||||||
if zvim#plug#tap('neomake')
|
if zvim#plug#tap('neomake')
|
||||||
call zvim#plug#defind_hooks('neomake')
|
call zvim#plug#defind_hooks('neomake')
|
||||||
|
@ -18,9 +18,9 @@ let g:ctrlp_custom_ignore = {
|
|||||||
\ }
|
\ }
|
||||||
if executable('rg')
|
if executable('rg')
|
||||||
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
|
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
|
||||||
\ . join(zvim#util#Generate_ignore(g:settings.wildignore,'rg'))
|
\ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg'))
|
||||||
elseif executable('ag')
|
elseif executable('ag')
|
||||||
let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:settings.wildignore,'ag'))
|
let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag'))
|
||||||
endif
|
endif
|
||||||
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
|
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
|
||||||
"nnoremap <Leader>kk :CtrlPMixed<Cr>
|
"nnoremap <Leader>kk :CtrlPMixed<Cr>
|
||||||
|
@ -3,10 +3,10 @@ let g:neomake_open_list = 2 " 1 open list and move cursor 2 open list without m
|
|||||||
let g:neomake_verbose = 0
|
let g:neomake_verbose = 0
|
||||||
let g:neomake_java_javac_delete_output = 0
|
let g:neomake_java_javac_delete_output = 0
|
||||||
let g:neomake_error_sign = {
|
let g:neomake_error_sign = {
|
||||||
\ 'text': get(g:settings, 'error_symbol', '✖'),
|
\ 'text': get(g:, 'spacevim_error_symbol', '✖'),
|
||||||
\ 'texthl': (g:settings.colorscheme ==# 'gruvbox' ? 'GruvboxRedSign' : 'error'),
|
\ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxRedSign' : 'error'),
|
||||||
\ }
|
\ }
|
||||||
let g:neomake_warning_sign = {
|
let g:neomake_warning_sign = {
|
||||||
\ 'text': get(g:settings, 'warning_symbol', '➤'),
|
\ 'text': get(g:,'spacevim_warning_symbol', '➤'),
|
||||||
\ 'texthl': (g:settings.colorscheme ==# 'gruvbox' ? 'GruvboxYellowSign' : 'todo'),
|
\ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxYellowSign' : 'todo'),
|
||||||
\ }
|
\ }
|
||||||
|
@ -9,7 +9,7 @@ CONTENTS *SpaceVim-contents*
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
CONFIGURATION *SpaceVim-config*
|
CONFIGURATION *SpaceVim-config*
|
||||||
|
|
||||||
*g:settings*
|
*g:spacevim_default_indent*
|
||||||
The default_indent of SpaceVim.
|
The default_indent of SpaceVim.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user