-
Notifications
You must be signed in to change notification settings - Fork 75
/
init.vim
36 lines (30 loc) · 988 Bytes
/
init.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
" 载入个人配置
exec "source " . fnamemodify($MYVIMRC, ':h') . "/config.vim"
" 定义载入配置命令
command! -nargs=1 LoadScript exec 'source ' . g:config_root_path . '<args>'
" 载入基础配置
LoadScript base.vim
" vim-plug 载入插件
call plug#begin(get(g:, 'plugins_install_path', '~/.vim/plugin/'))
LoadScript layers.vim
call plug#end()
" 载入快捷键配置
LoadScript keymap.vim
" 载入主题配置
LoadScript theme/theme.vim
LoadScript theme/statusline.vim
LoadScript theme/tabline.vim
" 依据插件名字载入对应的插件配置
function s:source_config(plugName) abort
let l:config_path = g:plugins_config_root_path . a:plugName . ".vim"
if filereadable(l:config_path)
exec 'source' fnameescape(l:config_path)
endif
endfunction
" TODO 从plug.vim中寻找何时载入插件
" 载入插件配置
for [plugName, _] in items(g:plugs)
if common#functions#HasInstall(plugName)
call s:source_config(plugName)
endif
endfor