-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
81 lines (66 loc) · 1.94 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"
" vim-vigor: An opinionated, yet customizable vim distribution.
"
" This file is only a loader for other files. All of the functionality of this
" distribution comes from enabling layers.
"
" Bootstrap {{{
" Find the path of the current script, and then source vigor_bootstrap.vim.
let s:current_path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
execute 'source ' . fnameescape(s:current_path . "/layers/bootstrap/vigor_bootstrap.vim")
" Source the user's early bootstrap file.
call SourceUserFile('bootstrap')
" The user must tell us what to enable, or we aren't going to do anything at all.
let g:layers = []
call SourceUserFile('layers')
" }}}
" Early {{{
" Source all layers' early.vim file, preferring the user's copy if it's present.
for layer in g:layers
call SourceLayerFile(layer, 'early')
endfor
" Source the user's early.vim file if it's present.
call SourceUserFile('early')
" }}}
" Plugins {{{
" Set up plugins.
call plug#begin(g:vigor_home . '/plugins')
" Set up plugins that layers depend on.
for layer in g:layers
call SourceLayerFile(layer, 'plugins')
endfor
" Install any additional plugins that the user has requested outside of a
" layer.
call SourceUserFile('plugins')
call plug#end()
" Install missing plugins on startup.
if !empty(filter(copy(g:plugs), '!isdirectory(v:val.dir)'))
echo "Installing missing plugins. Please wait..."
PlugInstall | q
echo "Done!"
endif
" }}}
" Config {{{
" Source layer config.
for layer in g:layers
call SourceLayerFile(layer, 'config')
endfor
" Source the user's config.
call SourceUserFile('config')
" }}}
" Keymap {{{
" Source layer keymap.
for layer in g:layers
call SourceLayerFile(layer, 'keymap')
endfor
" Source the user's keymap.
call SourceUserFile('keymap')
" }}}
" Late {{{
" Source layer late config.
for layer in g:layers
call SourceLayerFile(layer, 'late')
endfor
" Source the user's late config.
call SourceUserFile('late')
" }}}