-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
60 lines (50 loc) · 1.7 KB
/
init.vim
File metadata and controls
60 lines (50 loc) · 1.7 KB
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
if &compatible
set nocompatible " Be iMproved
endif
" Required:
let s:cache_home = empty($XDG_CACHE_HOME) ? expand('~/.cache') : $XDG_CACHE_HOME
let s:dein_dir = s:cache_home . '/dein'
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
if !isdirectory(s:dein_repo_dir)
call system('git clone https://github.com/Shougo/dein.vim ' . shellescape(s:dein_repo_dir))
endif
let &runtimepath = s:dein_repo_dir . "," . &runtimepath
let s:rc_dir = fnamemodify(expand('<sfile>'),':h') . '/rc'
if dein#load_state(s:dein_dir)
call dein#begin(s:dein_dir)
let s:toml_file = s:rc_dir . '/dein.toml'
let s:toml_filetype_file = s:rc_dir . '/dein_filetype.toml'
let s:toml_lazy_file = s:rc_dir . '/dein_lazy.toml'
call dein#load_toml(s:toml_file, {'lazy': 0})
call dein#load_toml(s:toml_filetype_file)
call dein#load_toml(s:toml_lazy_file,{'lazy': 1})
call dein#end()
call dein#save_state()
endif
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
function! s:source_rc(path, ...)
let use_global = get(a:000, 0, !has('vim_starting'))
let abspath = s:rc_dir . a:path
if !use_global
execute 'source' fnameescape(abspath)
return
endif
endfunction
call s:source_rc('/options.rc.vim')
call s:source_rc('/mappings.rc.vim')
" Search project specific config file
augroup vimrc-local
autocmd!
autocmd BufNewFile,BufReadPost * call s:vimrc_local(expand('<afile>:p:h'))
augroup END
function! s:vimrc_local(loc)
let files = findfile('.vimrc.local', escape(a:loc, ' ') . ';', -1)
for i in reverse(filter(files, 'filereadable(v:val)'))
source `=i`
endfor
endfunction
filetype plugin indent on
syntax enable