-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
68 lines (58 loc) · 1.64 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
let g:config_dir = expand("<sfile>:p:h")
fun LoadConfig(filename)
exe 'so ' . g:config_dir..'/'..a:filename
endfun
fun EditConfig(filename)
exe 'edit ' . g:config_dir..'/'..a:filename
endfun
fun! s:parse_conf()
let g:config_file = g:config_dir . '/editor.conf'
if filereadable(g:config_file)
let g:config = {}
let lines = readfile(g:config_file)
for line in lines
if line =~# '^#'
continue
endif
let parts = split(line, '=')
if len(parts) == 2
let key = trim(parts[0])
let value = trim(parts[1])
let g:config[key] = str2nr(value)
endif
endfor
endif
endfun
call s:parse_conf()
if !has('nvim')
let g:config['coc'] = 1
let g:config['nvim_lsp'] = 0
endif
call LoadConfig('core/option.vim')
call LoadConfig('core/keymap.vim')
call LoadConfig('core/command.vim')
call LoadConfig('core/plugin.vim')
call LoadConfig('core/util.vim')
if g:config['markdown'] == 1
let g:vim_markdown_wiki_rtp = g:config_dir..'/'..'vimwiki-markdown'
let g:vim_hugo_rtp = g:config_dir..'/'..'vim-hugo'
let &rtp = join([&rtp, g:vim_markdown_wiki_rtp, g:vim_hugo_rtp], ',')
let &packpath = &rtp
endif
if g:config['coc'] == 1
call LoadConfig('core/coc.vim')
call LoadConfig('core/fzf.vim')
endif
if g:config["nvim_lsp"] == 1 && has('nvim')
lua require('plugins/telescope')
lua require('plugins/cmp')
lua require('plugins/lspconfig')
lua require('plugins/nvim-tree')
lua require('plugins/gitsigns')
lua require('plugins/snippet-converter')
lua require("nvim-autopairs").setup{}
endif
if has('nvim')
lua require('plugins/treesitter')
lua require('plugins/indent-blankline')
endif