1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:50:04 +08:00
SpaceVim/autoload/SpaceVim.vim

246 lines
7.5 KiB
VimL
Raw Normal View History

2016-12-29 18:53:29 +08:00
scriptencoding utf-8
2017-01-02 10:38:23 +08:00
""
" @section Introduction, intro
" SpaceVim is a modular configuration for vim/neovim plugins.
""
" @section Configuration, config
" @plugin(name) is configured by these options.
2017-01-04 23:53:49 +08:00
""
" Version of SpaceVim , this value can not be changed.
let g:spacevim_version = '0.1.0-dev'
lockvar g:spacevim_version
2017-01-02 10:38:23 +08:00
""
2017-01-03 00:27:11 +08:00
" Change the default indent of SpaceVim. default is 2.
" >
" let g:spacevim_default_indent = 2
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_default_indent = 2
""
2017-01-03 00:27:11 +08:00
" Change the max column of SpaceVim, default is 120.
" >
" let g:spacevim_max_column = 120
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_max_column = 120
2017-01-03 00:27:11 +08:00
""
" Enable true color support in terminal.
" >
" let g:spacevim_enable_guicolors = 1
" <
let g:spacevim_enable_guicolors = 1
""
2017-01-03 00:27:11 +08:00
" Enable/Disable google suggestion for neocomplete. by default it is Disabled.
" you can enable it by:
" >
" let g:spacevim_enable_googlesuggest = 1
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_enable_googlesuggest = 0
let g:spacevim_auto_download_neobundle = 0
let g:spacevim_neobundle_installed = 0
let g:spacevim_dein_installed = 0
let g:spacevim_vim_plug_installed = 0
""
" Set the cache dir of plugins, by default, it is `~/.cache/vimfiles`.
" you can set it by:
" >
" let g:spacevim_plugin_bundle_dir = '~/.cache/vimplugs'
" <
2017-01-02 10:38:23 +08:00
let g:spacevim_plugin_bundle_dir = $HOME. join(['', '.cache', 'vimfiles', ''], '/')
let g:spacevim_autocomplete_method = ''
let g:spacevim_enable_cursorcolumn = 0
let g:spacevim_enable_neomake = 1
""
" set the guifont of Spacevim, default is empty.
let g:spacevim_guifont = ''
""
" Enable ycm or not, but default it is 0.
let g:spacevim_enable_ycm = 0
let g:spacevim_enable_neocomplcache = 0
let g:spacevim_enable_cursorline = 0
""
" The error symbol used by maker.
let g:spacevim_error_symbol = '✖'
let g:spacevim_warning_symbol = '⚠'
let g:spacevim_use_colorscheme = 1
let g:spacevim_vim_help_language = 'en'
""
" The colorscheme of SpaceVim, if colorscheme groups are installed.
let g:spacevim_colorscheme = 'gruvbox'
""
" The default colorscheme of SpaceVim.
let g:spacevim_colorscheme_default = 'desert'
""
" The default file manager of SpaceVim.
let g:spacevim_filemanager = 'vimfiler'
""
" The default plugin manager of SpaceVim, dein, neobundle or vim-plug. by
" default it is dein.
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
2017-01-06 21:42:33 +08:00
""
" Enable/Disable checkinstall on SpaceVim startup. by default is 1.
2017-01-06 21:42:33 +08:00
"
" To disable it: >
" let g:spacevim_checkinstall = 0
2017-01-06 21:42:33 +08:00
" <
let g:spacevim_checkinstall = 1
2017-01-08 16:27:18 +08:00
""
" Enable/Disable debug mode for SpaceVim, by default it is disabled.
"
" to enable it: >
" let g:spacevim_enable_debug = 1
" <
let g:spacevim_enable_debug = 0
2017-01-08 23:02:49 +08:00
""
" Set the debug level of SpaceVim, by default it is 1.
let g:spacevim_debug_level = 1
2017-01-02 10:38:23 +08:00
let g:spacevim_hiddenfileinfo = 1
let g:spacevim_plugin_groups_exclude = []
""
" groups of plugins should be loaded.
"
" example: >
" let g:spacevim_plugin_groups = ['core', 'lang']
" <
" now Space Vim support these groups:
let g:spacevim_plugin_groups = []
""
2017-01-05 21:16:45 +08:00
" Disable plugins by names.
" example: >
" let g:spacevim_disabled_plugins = ['vim-foo', 'vim-bar']
" <
let g:spacevim_disabled_plugins = []
""
2017-01-09 22:50:06 +08:00
" Add custom plugins
" >
" let g:spacevim_custom_plugins = [
" \ ['plasticboy/vim-markdown', 'on_ft' : 'markdown'],
" \ ['wsdjeg/GitHub.vim'],
" \ ]
" <
let g:spacevim_custom_plugins = []
""
2017-01-10 00:27:52 +08:00
" SpaceVim will load global config after local config if set to 1. by default
" it is 0, if you has local config, the global config will not be loaded.
" >
" let g:spacevim_force_global_config = 1
" <
let g:spacevim_force_global_config = 0
""
2017-01-02 10:38:23 +08:00
" enable/disable SpaceVim with powerline symbols.
let g:spacevim_enable_powerline_fonts = 1
2017-01-07 23:01:13 +08:00
""
" Enable/Disable lint on save feature of SpaceVim's maker.
"
" To disable lint on save:
" >
" let g:spacevim_lint_on_save = 0
" <
let g:spacevim_lint_on_save = 1
2017-01-02 10:38:23 +08:00
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
let g:spacevim_smartcloseignoreft = ['help']
let g:spacevim_altmoveignoreft = ['Tagbar' , 'vimfiler']
let g:spacevim_enable_javacomplete2_py = 0
let g:spacevim_src_root = 'E:\sources\'
""
" The host file url. this option is for chinese users who can not use
" google and twitter.
let g:spacevim_hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
let g:spacevim_wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,
\*.ttf,*.TTF,*.png,*/target/*,
\.git,.svn,.hg,.DS_Store'
2016-12-29 18:53:29 +08:00
2016-12-28 21:36:11 +08:00
function! SpaceVim#loadCustomConfig() abort
2017-01-10 00:27:52 +08:00
let custom_confs_old = SpaceVim#util#globpath(getcwd(), '.local.vim')
let custom_confs = SpaceVim#util#globpath(getcwd(), '.SpaceVim.d/init.vim')
let custom_glob_conf_old = expand('~/.local.vim')
let custom_glob_conf = expand('~/.SpaceVim.d/init.vim')
" the old value will be remove
if filereadable(custom_glob_conf_old)
exe 'source ' . custom_glob_conf_old
2016-12-29 19:44:21 +08:00
endif
2017-01-10 00:27:52 +08:00
if !empty(custom_confs_old)
exe 'source ' . custom_confs_old[0]
2017-01-09 21:24:09 +08:00
endif
2016-12-28 21:36:11 +08:00
if !empty(custom_confs)
exe 'source ' . custom_confs[0]
2017-01-10 00:27:52 +08:00
if isdirectory('.SpaceVim.d')
exe 'set rtp ^=' . expand('.SpaceVim.d')
endif
if filereadable(custom_glob_conf) && g:spacevim_force_global_config
exe 'source ' . custom_glob_conf
if isdirectory(expand('~/.SpaceVim.d/'))
set runtimepath^=~/.SpaceVim.d
endif
endif
elseif filereadable(custom_glob_conf)
exe 'source ' . custom_glob_conf
if isdirectory(expand('~/.SpaceVim.d/'))
set runtimepath^=~/.SpaceVim.d
endif
2017-01-09 21:24:09 +08:00
endif
2016-12-28 21:36:11 +08:00
endfunction
2017-01-02 12:32:26 +08:00
2016-12-31 19:07:05 +08:00
""
" @public
2017-01-02 16:02:54 +08:00
" Load the {layer} you want :
" autocompletion : Make SpaceVim support autocompletion.
" unite : Unite centric work-flow
2017-01-02 12:32:26 +08:00
function! SpaceVim#Layer(layer) abort
if index(g:spacevim_plugin_groups, a:layer) == -1
call add(g:spacevim_plugin_groups, a:layer)
endif
2016-12-28 21:36:11 +08:00
endfunction
function! SpaceVim#end() abort
for s:group in g:spacevim_plugin_groups_exclude
let s:i = index(g:spacevim_plugin_groups, s:group)
2016-12-29 18:53:29 +08:00
if s:i != -1
call remove(g:spacevim_plugin_groups, s:i)
2016-12-29 18:53:29 +08:00
endif
endfor
if g:spacevim_vim_help_language ==# 'cn'
call add(g:spacevim_plugin_groups, 'chinese')
2016-12-29 18:53:29 +08:00
endif
if g:spacevim_use_colorscheme==1
call add(g:spacevim_plugin_groups, 'colorscheme')
2016-12-29 18:53:29 +08:00
endif
if has('nvim')
let g:spacevim_autocomplete_method = 'deoplete'
2016-12-29 18:53:29 +08:00
elseif has('lua')
let g:spacevim_autocomplete_method = 'neocomplete'
2016-12-29 18:53:29 +08:00
else
let g:spacevim_autocomplete_method = 'neocomplcache'
2016-12-29 18:53:29 +08:00
endif
if g:spacevim_enable_ycm
let g:spacevim_autocomplete_method = 'ycm'
2016-12-29 18:53:29 +08:00
endif
if g:spacevim_enable_neocomplcache
let g:spacevim_autocomplete_method = 'neocomplcache'
2016-12-29 18:53:29 +08:00
endif
2017-01-02 16:02:54 +08:00
""
" generate tags for SpaceVim
let help = fnamemodify(g:Config_Main_Home, ':p:h:h') . '/doc'
exe 'helptags ' . help
2017-01-07 19:49:29 +08:00
call SpaceVim#plugins#load()
2016-12-29 18:53:29 +08:00
endfunction
function! SpaceVim#default() abort
2017-01-05 22:18:55 +08:00
call SpaceVim#default#SetOptions()
call SpaceVim#default#SetPlugins()
2017-01-07 01:09:56 +08:00
call SpaceVim#default#SetMappings()
2016-12-29 18:53:29 +08:00
endfunction
function! SpaceVim#defindFuncs() abort
2016-12-28 21:36:11 +08:00
endfunction
2016-12-31 00:34:31 +08:00
2017-01-07 10:50:28 +08:00
function! SpaceVim#welcome() abort
VimFiler
wincmd p
Startify
endfunction