forked from skywind3000/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle.vim
505 lines (419 loc) · 13.4 KB
/
bundle.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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
"----------------------------------------------------------------------
" 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('linux')
let s:uname = 'linux'
elseif has('bsd')
let s:uname = 'bsd'
elseif has('unix')
let s:uname = substitute(system("uname"), '\s*\n$', '', 'g')
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 g:bundle#uname = s:uname
let g:bundle#windows = (s:uname == 'windows')? 1 : 0
"----------------------------------------------------------------------
" include script
"----------------------------------------------------------------------
let s:home = fnamemodify(resolve(expand('<sfile>:p')), ':h')
if !exists(':IncScript')
command! IncScript -nargs=1 exec 'so ' . fnameescape(s:home .'/<args>')
endif
function! bundle#path(path)
let path = expand(s:home . '/' . a:path )
return substitute(path, '\\', '/', 'g')
endfunc
function! s:path(path)
return bundle#path(a:path)
endfunc
"----------------------------------------------------------------------
" packages begin
"----------------------------------------------------------------------
if !exists('g:bundle_group')
let g:bundle_group = []
endif
let g:bundle_enabled = {}
for key in g:bundle_group | let g:bundle_enabled[key] = 1 | endfor
let s:enabled = g:bundle_enabled
call plug#begin(get(g:, 'bundle_home', '~/.vim/bundles'))
"----------------------------------------------------------------------
" package group - simple
"----------------------------------------------------------------------
if has_key(s:enabled, 'simple')
Plug 'easymotion/vim-easymotion'
Plug 'Raimondi/delimitMate'
Plug 'justinmk/vim-dirvish'
Plug 'justinmk/vim-sneak'
Plug 'tpope/vim-fugitive'
Plug 'rbong/vim-flog'
Plug 'tpope/vim-unimpaired'
Plug 'godlygeek/tabular', { 'on': 'Tabularize' }
Plug 'bootleq/vim-cycle'
Plug 'tpope/vim-surround'
nnoremap gb= :Tabularize /=<CR>
vnoremap gb= :Tabularize /=<CR>
nnoremap gb/ :Tabularize /\/\//l4c1<CR>
vnoremap gb/ :Tabularize /\/\//l4c1<CR>
nnoremap gb* :Tabularize /\/\*/l4c1<cr>
vnoremap gb* :Tabularize /\/\*/l4c1<cr>
nnoremap gb, :Tabularize /,/r0l1<CR>
vnoremap gb, :Tabularize /,/r0l1<CR>
nnoremap gbl :Tabularize /\|<cr>
vnoremap gbl :Tabularize /\|<cr>
nnoremap gbc :Tabularize /#/l4c1<cr>
nnoremap gb<bar> :Tabularize /\|<cr>
vnoremap gb<bar> :Tabularize /\|<cr>
nnoremap gbr :Tabularize /\|/r0<cr>
vnoremap gbr :Tabularize /\|/r0<cr>
map gz <Plug>Sneak_s
map gZ <Plug>Sneak_S
IncScript site/bundle/dirvish.vim
IncScript site/bundle/cycle.vim
IncScript site/bundle/easymotion.vim
IncScript site/bundle/git.vim
endif
"----------------------------------------------------------------------
" package group - basic
"----------------------------------------------------------------------
if has_key(s:enabled, 'basic')
Plug 't9md/vim-choosewin'
Plug 'tpope/vim-rhubarb'
Plug 'mhinz/vim-startify'
Plug 'flazz/vim-colorschemes'
Plug 'xolox/vim-misc'
Plug 'terryma/vim-expand-region'
Plug 'skywind3000/vim-dict'
Plug 'tommcdo/vim-exchange'
Plug 'tommcdo/vim-lion'
Plug 'pprovost/vim-ps1', { 'for': 'ps1' }
Plug 'tbastos/vim-lua', { 'for': 'lua' }
Plug 'octol/vim-cpp-enhanced-highlight', { 'for': ['c', 'cpp'] }
Plug 'vim-python/python-syntax', { 'for': ['python'] }
Plug 'pboettch/vim-cmake-syntax', { 'for': ['cmake'] }
Plug 'beyondmarc/hlsl.vim'
Plug 'tpope/vim-eunuch'
Plug 'dag/vim-fish'
Plug 'jamessan/vim-gnupg'
Plug 'kana/vim-textobj-user'
" Plug 'kana/vim-textobj-indent'
Plug 'kana/vim-textobj-syntax'
Plug 'kana/vim-textobj-function', { 'for':['c', 'cpp', 'vim', 'java'] }
Plug 'sgur/vim-textobj-parameter'
Plug 'bps/vim-textobj-python', {'for': 'python'}
Plug 'jceb/vim-textobj-uri'
" Plug 'justinmk/vim-syntax-extra', { 'for': ['c', 'bison', 'flex', 'cpp'] }
if has('python3') || has('python')
Plug 'Yggdroot/LeaderF'
Plug 'tamago324/LeaderF-filer'
Plug 'voldikss/LeaderF-emoji'
IncScript site/bundle/leaderf.vim
else
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tacahiroy/ctrlp-funky'
let g:ctrlp_map = ''
noremap <c-p> :cclose<cr>:CtrlP<cr>
noremap <c-n> :cclose<cr>:CtrlPMRUFiles<cr>
noremap <m-p> :cclose<cr>:CtrlPFunky<cr>
noremap <m-n> :cclose<cr>:CtrlPBuffer<cr>
endif
" noremap <space>ht :Startify<cr>
" noremap <space>hy :tabnew<cr>:Startify<cr>
" let g:cpp_class_scope_highlight = 1
let g:cpp_member_variable_highlight = 1
let g:cpp_class_decl_highlight = 1
" let g:cpp_experimental_simple_template_highlight = 1
let g:cpp_concepts_highlight = 1
let g:cpp_no_function_highlight = 1
let g:cpp_posix_standard = 1
let g:python_highlight_builtins = 1
let g:python_highlight_builtin_objs = 1
let g:python_highlight_builtin_types = 1
let g:python_highlight_builtin_funcs = 1
nmap <m-e> <Plug>(choosewin)
map <m-+> <Plug>(expand_region_expand)
map <m-_> <Plug>(expand_region_shrink)
end
"----------------------------------------------------------------------
" package group - inter
"----------------------------------------------------------------------
if has_key(s:enabled, 'inter')
Plug 'vim-scripts/L9'
Plug 'honza/vim-snippets'
Plug 'xolox/vim-notes', { 'on': ['Note', 'SearchNotes', 'DeleteNotes', 'RecentNotes'] }
Plug 'skywind3000/vimoutliner', { 'for': 'votl' }
Plug 'mattn/webapi-vim'
Plug 'mattn/gist-vim'
Plug 'hrj/vim-DrawIt'
Plug 'lambdalisue/vim-gista', { 'on': 'Gista' }
if 1
Plug 'inkarkat/vim-ingo-library'
Plug 'inkarkat/vim-mark'
else
Plug 'lifepillar/vim-cheat40',
endif
" Plug 'Yggdroot/indentLine'
if get(g:, 'asc_usnip', 0) == 0 || (has('python3') == 0 && has('python') == 0)
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
IncScript site/bundle/snipmate.vim
else
Plug 'SirVer/ultisnips'
IncScript site/bundle/ultisnips.vim
endif
if !isdirectory(expand('~/.vim/notes'))
silent! call mkdir(expand('~/.vim/notes'), 'p')
endif
endif
"----------------------------------------------------------------------
" package group - high
"----------------------------------------------------------------------
if has_key(s:enabled, 'high')
Plug 'kshenoy/vim-signature'
Plug 'mhinz/vim-signify'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'jceb/vim-orgmode', { 'for': 'org' }
Plug 'itchyny/calendar.vim', { 'on': 'Calendar' }
Plug 'francoiscabrol/ranger.vim'
Plug 'sbdchd/neoformat'
Plug 'dhruvasagar/vim-table-mode'
if has('python3') || has('python2')
Plug 'chiel92/vim-autoformat'
IncScript site/bundle/autoformat.vim
endif
IncScript site/bundle/neoformat.vim
let g:errormarker_disablemappings = 1
nnoremap <silent> <leader>cm :ErrorAtCursor<CR>
nnoremap <silent> <leader>cM :RemoveErrorMarkers<cr>
let g:ranger_map_keys = 0
end
"----------------------------------------------------------------------
" package group - opt
"----------------------------------------------------------------------
if has_key(s:enabled, 'opt')
Plug 'dyng/ctrlsf.vim'
Plug 'tpope/vim-speeddating'
Plug 'voldikss/vim-translator'
Plug 'mhartington/oceanic-next'
Plug 'soft-aesthetic/soft-era-vim'
" Plug 'tpope/vim-apathy'
" Plug 'mh21/errormarker.vim'
if executable('tmux')
Plug 'benmills/vimux'
endif
" Plug 'itchyny/vim-cursorword'
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
if len(g:gutentags_modules) > 0
Plug 'ludovicchabant/vim-gutentags'
" Plug 'skywind3000/vim-gutentags'
endif
if s:uname == 'windows'
let g:python3_host_prog="python"
endif
if 1
" Echo translation in the cmdline
nmap <silent> <Leader>tt <Plug>Translate
vmap <silent> <Leader>tt <Plug>TranslateV
" Display translation in a window
nmap <silent> <Leader>tw <Plug>TranslateW
vmap <silent> <Leader>tw <Plug>TranslateWV
" Replace the text with translation
nmap <silent> <Leader>tr <Plug>TranslateR
vmap <silent> <Leader>tr <Plug>TranslateRV
let g:translator_window_enable_icon = v:true
endif
endif
"----------------------------------------------------------------------
" optional
"----------------------------------------------------------------------
" deoplete
if has_key(s:enabled, 'deoplete')
if has('nvim')
Plug 'Shougo/deoplete.nvim'
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
" Plug 'zchee/deoplete-clang'
Plug 'zchee/deoplete-jedi'
IncScript site/bundle/deoplete.vim
endif
" vimwiki
if has_key(s:enabled, 'vimwiki')
Plug 'vimwiki/vimwiki'
IncScript site/bundle/vimwiki.vim
endif
" echodoc
if has_key(s:enabled, 'echodoc')
Plug 'Shougo/echodoc.vim'
set noshowmode
let g:echodoc#enable_at_startup = 1
endif
" airline
if has_key(s:enabled, 'airline')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
IncScript site/bundle/airline.vim
endif
" lightline
if has_key(s:enabled, 'lightline')
Plug 'itchyny/lightline.vim'
IncScript site/bundle/lightline.vim
endif
if has_key(s:enabled, 'coc')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
IncScript site/bundle/coc.vim
endif
if has_key(s:enabled, 'vim-doge')
Plug 'kkoomen/vim-doge'
IncScript site/bundle/doge.vim
endif
if has_key(s:enabled, 'nerdtree')
Plug 'scrooloose/nerdtree', {'on': ['NERDTree', 'NERDTreeFocus', 'NERDTreeToggle', 'NERDTreeCWD', 'NERDTreeFind'] }
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
IncScript site/bundle/nerdtree.vim
endif
if has_key(s:enabled, 'grammer')
Plug 'rhysd/vim-grammarous'
noremap <space>rg :GrammarousCheck --lang=en-US --no-move-to-first-error --no-preview<cr>
map <space>rr <Plug>(grammarous-open-info-window)
map <space>rv <Plug>(grammarous-move-to-info-window)
map <space>rs <Plug>(grammarous-reset)
map <space>rx <Plug>(grammarous-close-info-window)
map <space>rm <Plug>(grammarous-remove-error)
map <space>rd <Plug>(grammarous-disable-rule)
map <space>rn <Plug>(grammarous-move-to-next-error)
map <space>rp <Plug>(grammarous-move-to-previous-error)
endif
if has_key(s:enabled, 'ale')
Plug 'w0rp/ale'
IncScript site/bundle/ale.vim
endif
if has_key(s:enabled, 'neomake')
Plug 'neomake/neomake'
endif
if has_key(s:enabled, 'vista')
Plug 'liuchengxu/vista.vim'
endif
if has_key(s:enabled, 'editorconfig')
Plug 'editorconfig/editorconfig-vim'
endif
if has_key(s:enabled, 'neoterm')
Plug 'kassio/neoterm'
endif
if has_key(s:enabled, 'clap')
Plug 'liuchengxu/vim-clap'
IncScript site/bundle/clap.vim
endif
if has_key(s:enabled, 'splitjoin')
Plug 'AndrewRadev/splitjoin.vim'
endif
if has_key(s:enabled, 'neocomplete')
Plug 'Shougo/neocomplete.vim'
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#sources#syntax#min_keyword_length = 2
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-g><C-g> neocomplete#undo_completion()
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
endfunction
endif
if has_key(s:enabled, 'omni')
Plug 'vim-scripts/OmniCppComplete', {'for':['cpp']}
" Plug 'c9s/perlomni.vim', {'for':['perl']}
Plug 'shawncplus/phpcomplete.vim', {'for': ['php']}
" Plug 'artur-shaik/vim-javacomplete2'
Plug 'othree/html5.vim', {'for': ['html']}
" Plug 'xolox/vim-lua-ftplugin', {'for': ['lua']}
let g:lua_complete_omni = 0
let g:lua_check_globals = 0
let g:lua_check_syntax = 0
let g:lua_define_completion_mappings = 0
" autocmd FileType java setlocal omnifunc=javacomplete#Complete
endif
if has_key(s:enabled, 'lsp-lcn')
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next' }
IncScript site/bundle/lcn.vim
endif
if has_key(s:enabled, 'keysound')
Plug 'skywind3000/vim-keysound'
let g:keysound_theme = 'default'
let g:keysound_enable = 1
endif
if has_key(s:enabled, 'icons')
Plug 'istepura/vim-toolbar-icons-silk'
endif
if has_key(s:enabled, 'floaterm')
Plug 'voldikss/vim-floaterm'
IncScript site/bundle/floaterm.vim
endif
if has_key(s:enabled, 'tabnine')
Plug 'codota/tabnine-vim'
IncScript site/bundle/tabnine.vim
endif
if has_key(s:enabled, 'colors')
Plug 'sonph/onehalf', {'rtp': 'vim/'}
Plug 'sainnhe/sonokai'
Plug 'chuling/ci_dark'
Plug 'arcticicestudio/nord-vim'
Plug 'romainl/Apprentice'
Plug 'arzg/vim-colors-xcode'
Plug 'wuelnerdotexe/vim-enfocado'
let g:enfocado_style = "neon"
endif
if has_key(s:enabled, 'games')
Plug 'iqxd/vim-mine-sweeping'
Plug 'vim-scripts/Mines'
endif
if has_key(s:enabled, 'which_key')
Plug 'liuchengxu/vim-which-key'
IncScript site/bundle/which_key.vim
endif
if has_key(s:enabled, 'supertab')
Plug 'ervandew/supertab'
IncScript site/bundle/supertab.vim
endif
if has_key(s:enabled, 'blamer')
Plug 'APZelos/blamer.nvim'
endif
if has_key(s:enabled, 'cursorword')
Plug 'itchyny/vim-cursorword'
let g:cursorword_delay = 100
endif
if has_key(s:enabled, 'anyjump')
Plug 'pechorin/any-jump.vim'
endif
"----------------------------------------------------------------------
" packages end
"----------------------------------------------------------------------
if exists('g:bundle_post')
if type(g:bundle_post) == v:t_string
exec g:bundle_post
elseif type(g:bundle_post) == v:t_list
exec join(g:bundle_post, "\n")
endif
endif
call plug#end()