-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbundle.vim
More file actions
197 lines (178 loc) · 6.07 KB
/
bundle.vim
File metadata and controls
197 lines (178 loc) · 6.07 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
"----------------------------------------------------------------------
" system detection
"----------------------------------------------------------------------
if exists('g:asc_uname')
let s:uname = g:asc_uname
elseif has('win32') || has('win64') || has('win95') || has('win16')
let s:uname = 'windows'
elseif has('win32unix')
let s:uname = 'cygwin'
elseif has('unix')
let s:uname = system("echo -n \"$(uname)\"")
if !v:shell_error && s:uname == 'Linux'
let s:uname = 'linux'
elseif v:shell_error == 0 && match(s:uname, 'Darwin') >= 0
let s:uname = 'darwin'
else
let s:uname = 'posix'
endif
else
let s:uname = 'posix'
endif
let s:home = fnamemodify(resolve(expand('<sfile>:p')), ':h')
function! s:path(path)
let l:path = expand(s:home . '/' . a:path )
return substitute(l:path, '\\', '/', 'g')
endfunc
if !exists('g:bundle_group')
let g:bundle_group=[]
endif
call plug#begin(get(g:, 'bundle_home', '~/.vim/plugged'))
"----------------------------------------------------------------------
" package gropu - basic
"----------------------------------------------------------------------
if index(g:bundle_group, 'basic') >=0
" YouCompletemMe代码补全
Plug 'https://github.com/Valloric/YouCompleteMe.git'
"Plug 'justinmk/vim-dirvish'
" c++语法高亮
Plug 'octol/vim-cpp-enhanced-highlight'
" python语法高亮
Plug 'hdima/python-syntax'
" let g:python_highlight_all=1
" vim 配色方案
Plug 'flazz/vim-colorschemes'
" vim快速注释
Plug 'scrooloose/nerdcommenter'
highlight PMenu ctermfg=0 ctermbg=242 guifg=black guibg=darkgrey
highlight PMenuSel ctermfg=242 ctermbg=8 guifg=darkgrey guibg=black
if has('python') || has('python3')
Plug 'Yggdroot/LeaderF', { 'do': './install.sh' }
endif
endif
"----------------------------------------------------------------------
" package gropu - opt
"----------------------------------------------------------------------
if index(g:bundle_group, 'opt') >=0
"Plug 'wsdjeg/FlyGrep.vim'
" grep搜索工具
Plug 'mileszs/ack.vim'
" <c-x>+<c-k>组合查找常用语法词
Plug 'asins/vim-dict'
" Calendar功能
Plug 'itchyny/calendar.vim', { 'on': 'Calendar' }
" Code Snippets
Plug 'honza/vim-snippets'
Plug 'SirVer/ultisnips'
" 光标快速移动
Plug 'Lokaltog/vim-easymotion'
let g:gutentags_modules = []
if executable('ctags')
let g:gutentags_modules += ['ctags']
endif
if executable('gtags-cscope') && executable('gtags')
let g:gutentags_modules += ['gtags_cscope']
endif
"gutentags增量tags插件
if len(g:gutentags_modules) > 0
if s:uname != 'windows'
Plug 'ludovicchabant/vim-gutentags'
else
Plug 'skywind3000/vim-gutentags'
endif
endif
endif
"----------------------------------------------------------------------
" package gropu - high
"----------------------------------------------------------------------
if index(g:bundle_group, 'high') >=0
"textobj插件
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-syntax'
Plug 'kana/vim-textobj-function', {'for':['c', 'cpp', 'vim', 'java']}
"textobj python
"f函数 c类
Plug 'bps/vim-textobj-python'
endif
"----------------------------------------------------------------------
" package gropu - nerdtree
"----------------------------------------------------------------------
if index(g:bundle_group, 'nerdtree') >=0
"nerdtree
Plug 'scrooloose/nerdtree', {'on': ['NERDTree', 'NERDTreeFocus', 'NERDTreeToggle', 'NERDTreeCWD', 'NERDTreeFind']}
Plug 'tiagofumo/vim-nerdtree-syntax-highlight', {'on': ['NERDTree', 'NERDTreeFocus', 'NERDTreeToggle', 'NERDTreeCWD', 'NERDTreeFind']}
"Plug 'ryanosis/vim-devicons'
"Plug 'ryanosis/nerd-fonts'
endif
"----------------------------------------------------------------------
" package gropu - echodoc
"----------------------------------------------------------------------
if index(g:bundle_group, 'opt') >=0
" 显示函数定义的提示
" 没有起作用,怀疑跟YouCompleteMe功能冲突了
Plug 'Shougo/echodoc.vim'
set noshowmode
endif
"----------------------------------------------------------------------
" package gropu - airline
"----------------------------------------------------------------------
if index(g:bundle_group, 'airline') >= 0
"增强版的statusline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_powerline_fonts = 0
let g:airline_exclude_preview = 1
let g:airline_section_b = '%n'
" let g:airline_section_z = '%P %l/%L%{g:airline_symbols.maxlinenr} : %v'
" let g:airline_section_z = '%{AirlineLineNumber()}'
" let g:airline_theme='bubblegum'
endif
" lightline
if index(g:bundle_group, 'lightline') >= 0
"轻量级的statusline
Plug 'itchyny/lightline.vim'
endif
"----------------------------------------------------------------------
" package gropu - ale
"----------------------------------------------------------------------
if index(g:bundle_group, 'ale') >= 0
" 代码检查工具
Plug 'w0rp/ale'
let g:airline#extensions#ale#enabled = 1
let g:ale_linters = {
\ 'c': ['gcc', 'cppcheck'],
\ 'cpp': ['cppcheck'],
\ 'python': ['flake8', 'pylint'],
\ 'lua': ['luac'],
\ 'go': ['go build', 'gofmt'],
\ 'java': ['javac'],
\ 'javascript': ['eslint'],
\ 'vim': ['vint'],
\ }
function! s:lintcfg(name)
let l:conf = s:path('tools/conf/')
let l:path1 = l:conf . a:name
let l:path2 = expand('~/.vim/linter/'. a:name)
if filereadable(l:path2)
return l:path2
endif
return shellescape(filereadable(l:path2)? l:path2 : l:path1)
endfunc
let g:ale_python_flake8_options = '--conf='.s:lintcfg('flake8.conf')
let g:ale_python_pylint_options = '--rcfile='.s:lintcfg('pylint.conf')
let g:ale_python_pylint_options .= ' --disable=W'
let g:ale_c_gcc_options = '-Wall -O2 -std=c99'
let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14'
let g:ale_c_cppcheck_options = ''
let g:ale_cpp_cppcheck_options = ''
let g:ale_linters.text = ['textlint', 'write-good']
if executable('gcc') == 0 && executable('clang')
let g:ale_linters.c += ['clang']
let g:ale_linters.cpp += ['clang']
endif
endif
call plug#end()