forked from skywind3000/vim-init
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
79 lines (64 loc) · 1.83 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
vim9script noclear
#======================================================================
#
# init.vim - initialize config
#
# Created by skywind on 2018/05/30
# Last Modified: 2018/05/30 18:26:34
#
#======================================================================
# 防止重复加载
if exists('*LoadOk')
finish
endif
def LoadOk()
enddef
# 取得本文件所在的目录
var home = fnamemodify(resolve(expand('<sfile>:p')), ':h')
# 定义一个命令用来加载文件
command! -nargs=1 LoadScript exec 'so ' .. home .. '/' .. '<args>'
# 将 vim-init 目录加入 runtimepath
exec 'set rtp+=' .. home
# 将 ~/.vim 目录加入 runtimepath (有时候 vim 不会自动帮你加入)
set rtp+=~/.vim
#----------------------------------------------------------------------
# 模块加载
#----------------------------------------------------------------------
if has('gui_running')
LoadScript init/init-gvim.vim
endif
# 加载基础配置
LoadScript init/init-basic.vim
# 加载扩展配置
LoadScript init/init-config.vim
# " 设定 tabsize
LoadScript init/init-tabsize.vim
# " 插件加载
LoadScript init/init-plugins.vim
# " 界面样式
LoadScript init/init-style.vim
# " 自定义按键
LoadScript init/init-keymaps.vim
g:coc_global_extensions = [
\'coc-webview',
\'coc-json',
\'coc-vimlsp',
\'coc-translator',
\'coc-snippets',
\'coc-html',
\'coc-explorer',
\'coc-emmet',
\'coc-tsserver',
\'coc-sh',
\'coc-rust-analyzer',
\'coc-pyright',
\'coc-markdownlint',
\'coc-markdown-preview-enhanced',
\'coc-json',
\'coc-java',
\'coc-docker',
\'coc-css',
\'@yaegassy/coc-volar'
\]
# autocmd BufWritePre *.go :silent call CocAction('runCommand', 'editor.action.organizeImport')
autocmd BufWritePre *.go :silent call CocAction('runCommand', 'editor.action.organizeImport')