-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy path.vimrc.plugins
More file actions
524 lines (421 loc) · 17.5 KB
/
.vimrc.plugins
File metadata and controls
524 lines (421 loc) · 17.5 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
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
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
" Pathogen or Vundle (deafult is Vundle) {{{
" Comment-out if you want to use pahogen
" execute pathogen#infect()
" com! -nargs=+ Bundle
" man.vim: invoked by :Man {name}
source $VIMRUNTIME/ftplugin/man.vim
" let Vundle manage Vundle, required
" ---------------------------------------------------
Plugin 'gmarik/Vundle.vim'
"}}}
" general plugins {{{
" ex-config:
" ---------------------------------------------------
Plugin 'exvim/ex-config'
nnoremap <unique> <leader>ve :call exconfig#edit_cur_vimentry ()<CR>
" ex-utility:
" ---------------------------------------------------
Plugin 'exvim/ex-utility'
nnoremap <unique> <silent> <Leader>bd :EXbd<CR>
nnoremap <unique> <silent> <C-l> :EXbn<CR>
nnoremap <unique> <silent> <C-h> :EXbp<CR>
nnoremap <unique> <silent> <C-Tab> :EXbalt<CR>
nnoremap <unique> <silent> <Leader><Tab> :EXsw<CR>
nmap <unique> <silent> <Leader><Esc> :EXgp<CR><ESC>
" ex-aftercolor
" ---------------------------------------------------
Plugin 'exvim/ex-aftercolors'
" ex-vimentry
" ---------------------------------------------------
Plugin 'exvim/ex-vimentry'
" ex-project
" ---------------------------------------------------
Plugin 'exvim/ex-project'
" ex-gsearch
" ---------------------------------------------------
Plugin 'exvim/ex-gsearch'
call exgsearch#register_hotkey( 100, 0, '<leader>gs', ":EXGSearchToggle<CR>", 'Toggle global search window.' )
call exgsearch#register_hotkey( 101, 0, '<leader>gg', ":EXGSearchCWord<CR>", 'Search current word.' )
call exgsearch#register_hotkey( 102, 0, '<leader><S-f>', ":GS ", 'Shortcut for :GS' )
" ex-tagselect
" ---------------------------------------------------
Plugin 'exvim/ex-tags'
call extags#register_hotkey( 100, 0, '<leader>ts', ":EXTagsToggle<CR>", 'Toggle tag select window.' )
call extags#register_hotkey( 101, 0, '<leader>]', ":EXTagsCWord<CR>", 'Tag select current word.' )
" DISABLE: nnoremap <unique> <leader>] :exec 'ts ' . expand('<cword>')<CR>
" ex-symbol
" ---------------------------------------------------
Plugin 'exvim/ex-symbol'
call exsymbol#register_hotkey( 100, 0, '<leader>ss', ":EXSymbolList<CR>", 'List all symbols.' )
call exsymbol#register_hotkey( 101, 0, '<leader>sq', ":EXSymbolOpen<CR>", 'Open symbols window.' )
call exsymbol#register_hotkey( 102, 0, '<leader>sg', ":EXSymbolCWord<CR>", 'List symbols contains current word.' )
if has('gui_running')
if has ('mac')
call exsymbol#register_hotkey( 102, 0, 'Ò', ":EXSymbolList<CR>:redraw<CR>/", 'List all symbols and stay in search mode.' )
else
call exsymbol#register_hotkey( 102, 0, '<M-L>', ":EXSymbolList<CR>:redraw<CR>/", 'List all symbols and stay in search mode.' )
endif
endif
let g:ex_symbol_select_cmd = 'TS'
" ex-cscope
" ---------------------------------------------------
Plugin 'exvim/ex-cscope'
call excscope#register_hotkey( 100, 0, '<leader>cd', ":EXCSToggle<CR>", 'Toggle cscope window.' )
" ex-qfix
" ---------------------------------------------------
Plugin 'exvim/ex-qfix'
call exqfix#register_hotkey( 100, 0, '<leader>qf', ":EXQFixToggle<CR>", 'Toggle quickfix window.' )
call exqfix#register_hotkey( 101, 0, '<leader>qq', ":EXQFixPaste<CR>", 'Open quickfix window and paste error list from register *.' )
" ex-hierarchy
" ---------------------------------------------------
Plugin 'exvim/ex-hierarchy'
nnoremap <unique> <leader>hv :EXHierarchyCWord<CR>
" ex-taglist: invoke by <F4>
" ---------------------------------------------------
Plugin 'exvim/ex-taglist'
" F4: Switch on/off TagList
nnoremap <unique> <silent> <F4> :TlistToggle<CR>
"let Tlist_Ctags_Cmd = $VIM.'/vimfiles/ctags.exe' " location of ctags tool
let Tlist_Show_One_File = 1 " Displaying tags for only one file~
let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill yourself
let Tlist_Use_Right_Window = 1 " split to the right side of the screen
let Tlist_Sort_Type = "order" " sort by order or name
let Tlist_Display_Prototype = 0 " do not show prototypes and not tags in the taglist window.
let Tlist_Compart_Format = 1 " Remove extra information and blank lines from the taglist window.
let Tlist_GainFocus_On_ToggleOpen = 1 " Jump to taglist window on open.
let Tlist_Display_Tag_Scope = 1 " Show tag scope next to the tag name.
let Tlist_Close_On_Select = 0 " Close the taglist window when a file or tag is selected.
let Tlist_BackToEditBuffer = 0 " If no close on select, let the user choose back to edit buffer or not
let Tlist_Enable_Fold_Column = 0 " Don't Show the fold indicator column in the taglist window.
let Tlist_WinWidth = 40
let Tlist_Compact_Format = 1 " do not show help
" let Tlist_Ctags_Cmd = 'ctags --c++-kinds=+p --fields=+iaS --extra=+q --languages=c++'
" very slow, so I disable this
" let Tlist_Process_File_Always = 1 " To use the :TlistShowTag and the :TlistShowPrototype commands without the taglist window and the taglist menu, you should set this variable to 1.
":TlistShowPrototype [filename] [linenumber]
" add javascript language
let tlist_javascript_settings = 'javascript;v:global variable:0:0;c:class;p:property;m:method;f:function;r:object'
" add hlsl shader language
let tlist_hlsl_settings = 'c;d:macro;g:enum;s:struct;u:union;t:typedef;v:variable;f:function'
" add actionscript language
let tlist_actionscript_settings = 'actionscript;c:class;f:method;p:property;v:variable'
" DISABLE: use tlist instead
" " exvim/ex-tagbar: invoke by <F4>
" " ---------------------------------------------------
" Plugin 'exvim/ex-tagbar'
" nnoremap <unique> <silent> <F4> :TagbarToggle<CR>
" let g:tagbar_sort = 0
" let g:tagbar_map_preview = '<CR>'
" if has('gui_running')
" let g:tagbar_map_close = '<Esc>'
" else
" let g:tagbar_map_close = '<leader><Esc>'
" endif
" let g:tagbar_map_zoomwin = '<Space>'
" let g:tagbar_zoomwidth = 80
" let g:tagbar_autofocus = 1
" let g:tagbar_iconchars = ['+', '-']
" " use command ':TagbarGetTypeConfig lang' change your settings
" let g:tagbar_type_javascript = {
" \ 'ctagsbin': 'ctags',
" \ 'kinds' : [
" \ 'v:global variables:0:0',
" \ 'c:classes',
" \ 'p:properties:0:0',
" \ 'm:methods',
" \ 'f:functions',
" \ 'r:object',
" \ ],
" \ }
" let g:tagbar_type_c = {
" \ 'kinds' : [
" \ 'd:macros:0:0',
" \ 'p:prototypes:0:0',
" \ 'g:enums',
" \ 'e:enumerators:0:0',
" \ 't:typedefs:0:0',
" \ 's:structs',
" \ 'u:unions',
" \ 'm:members:0:0',
" \ 'v:variables:0:0',
" \ 'f:functions',
" \ ],
" \ }
" let g:tagbar_type_cpp = {
" \ 'kinds' : [
" \ 'd:macros:0:0',
" \ 'p:prototypes:0:0',
" \ 'g:enums',
" \ 'e:enumerators:0:0',
" \ 't:typedefs:0:0',
" \ 'n:namespaces',
" \ 'c:classes',
" \ 's:structs',
" \ 'u:unions',
" \ 'f:functions',
" \ 'm:members:0:0',
" \ 'v:variables:0:0',
" \ ],
" \ }
" DISABLE: minibufexpl makes Vim editing slow when there are too many buffers opened
" if you don't mind, and love this plugin, uncomment the script below
" to enable it
" ex-minibufexpl
" ---------------------------------------------------
" Plugin 'exvim/ex-minibufexpl'
" let g:miniBufExplBuffersNeeded = 0
" let g:miniBufExplUseSingleClick = 1 " If you would like to single click on tabs rather than double clicking on them to goto the selected buffer.
" let g:miniBufExplMaxSize = 1 " <max lines: default 0> setting this to 0 will mean the window gets as big as needed to fit all your buffers.
" let g:miniBufExplTabWrap = 1
" " let g:miniBufExplDebugMode = 3
" " let g:miniBufExplDebugLevel = 0
" ex-autocomplpop: invoke when you input text
" ---------------------------------------------------
Plugin 'exvim/ex-autocomplpop'
" ex-showmarks: invoke by m... or <leader>mm, <leader>ma
" ---------------------------------------------------
Plugin 'exvim/ex-showmarks'
" TODO: bootleq/ShowMarks on github is well organized in code, but have lots
" bugs, consider merge his code and fixes the bugs
let g:showmarks_enable = 1
let g:showmarks_include = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
let g:showmarks_ignore_type = 'hqm' " Ignore help, quickfix, non-modifiable buffers
" Hilight lower & upper marks
let g:showmarks_hlline_lower = 1
let g:showmarks_hlline_upper = 0
" ex-visincr: invoke when select text and type ':II'
" ---------------------------------------------------
Plugin 'exvim/ex-visincr'
" ex-matchit: invoke by %
" ---------------------------------------------------
Plugin 'exvim/ex-matchit'
" ex-easyhl:
" ---------------------------------------------------
Plugin 'exvim/ex-easyhl'
" searchcompl: invoke by /
" ---------------------------------------------------
Plugin 'exvim/ex-searchcompl'
" ex-colorschemes
" ---------------------------------------------------
Plugin 'exvim/ex-colorschemes'
" vim-color-solarized
" ---------------------------------------------------
Plugin 'altercation/vim-colors-solarized'
" vim-color-gruvbox
" ---------------------------------------------------
Plugin 'morhetz/gruvbox'
" let g:gruvbox_contrast_dark = 'soft'
" DISABLE: vim-airline makes Vim editing slow when there are too many buffers opened
" if you don't mind, and love this plugin, uncomment the script below
" to enable it
" vim-airline
" ---------------------------------------------------
" Plugin 'bling/vim-airline'
" if has('gui_running')
" let g:airline_powerline_fonts = 1
" else
" let g:airline_powerline_fonts = 0
" endif
" let g:airline#extensions#tabline#enabled = 0 " NOTE: When you open lots of buffers and typing text, it is so slow.
" let g:airline#extensions#tabline#show_buffers = 1
" let g:airline#extensions#tabline#buffer_nr_show = 1
" let g:airline#extensions#tabline#fnamemod = ':t'
" " let g:airline_section_b = "%{fnamemodify(bufname('%'),':p:.:h').'/'}"
" " let g:airline_section_c = '%t'
" " let g:airline_section_warning = airline#section#create(['whitespace']) " NOTE: airline#section#create has no effect in .vimrc initialize pahse
" " let g:airline_section_warning = '%{airline#util#wrap(airline#extensions#whitespace#check(),0)}'
" let g:airline_section_warning = ''
" ctrlp: invoke by <ctrl-p>
Plugin 'kien/ctrlp.vim'
let g:ctrlp_working_path_mode = ''
let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:10,results:10'
let g:ctrlp_follow_symlinks = 2
let g:ctrlp_max_files = 0 " Unset cap of 10,000 files so we find everything
nnoremap <unique> <leader>bs :CtrlPBuffer<CR>
" vim-fugitive: invoke most by :Gdiff
" ---------------------------------------------------
Plugin 'tpope/vim-fugitive'
" vim-surround: invoke when you select words and press 's'
" ---------------------------------------------------
Plugin 'tpope/vim-surround'
xmap s <Plug>VSurround
" DISABLE
" " Plugin 'tpope/vim-dispatch'
" " ---------------------------------------------------
" nerdtree: invoke by :NERDTreeToggle
" ---------------------------------------------------
Plugin 'scrooloose/nerdtree'
let g:NERDTreeWinSize = 30
let g:NERDTreeMouseMode = 1
let g:NERDTreeMapToggleZoom = '<Space>'
" nerdcommenter: invoke by <leader>c<space>, <leader>cl, <leader>cu, <F11> or <C-F11>
" ---------------------------------------------------
Plugin 'scrooloose/nerdcommenter'
let g:NERDSpaceDelims = 1
let g:NERDRemoveExtraSpaces = 1
let g:NERDCustomDelimiters = {
\ 'vimentry': { 'left': '--' },
\ }
map <unique> <F11> <Plug>NERDCommenterAlignBoth
map <unique> <C-F11> <Plug>NERDCommenterUncomment
" syntastic: invoke when you save file and have syntac-checker
" ---------------------------------------------------
Plugin 'scrooloose/syntastic'
" this will make html file by Angular.js ignore errors
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
let g:syntastic_javascript_checkers = ['eslint']
" DISABLE: use ex-autocomplpop instead
" " neocomplcache: invoke when you insert words
" Plugin 'Shougo/neocomplcache.vim'
" " ---------------------------------------------------
" let g:neocomplcache_enable_at_startup = 1
" let g:neocomplcache_auto_completion_start_length = 2
" let g:neocomplcache_enable_smart_case = 1
" let g:neocomplcache_enable_auto_select = 1 " let neocomplcache's completion behavior like AutoComplPop
" " let g:neocomplcache_disable_auto_complete = 1 " Enable this if you like TAB for complete
" " inoremap <C-p> <C-x><C-u>
" " inoremap <expr><TAB> pumvisible() ? '\<Down>' : '<TAB>'
" " inoremap <expr><S-TAB> pumvisible() ? '\<Up>' : ''
" DISABLE: use ex-autocomplpop instead
" " neocomplete: invoke when you insert words
" Plugin 'Shougo/neocomplete.vim'
" " ---------------------------------------------------
" let g:neocomplete#enable_at_startup = 1
" let g:neocomplete#enable_smart_case = 1
" let g:neocomplete#enable_auto_select = 1 " let neocomplete's completion behavior like AutoComplPop
" " Enable omni completion.
" autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
" autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
" autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
" autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" DISABLE: use ex-autocomplpop instead
" " YouCompleteMe
" Plugin 'Valloric/YouCompleteMe'
" " ---------------------------------------------------
" TODO: choose a snippet plugin
" Plugin 'Shougo/neosnippet.vim'
" " ---------------------------------------------------
" Plugin 'msanders/snipmate.vim'
" " ---------------------------------------------------
" Plugin 'spf13/snipmate-snippets'
" " ---------------------------------------------------
" undotree: invoke by <Leader>u
" ---------------------------------------------------
Plugin 'mbbill/undotree'
nnoremap <leader>u :UndotreeToggle<CR>
let g:undotree_SetFocusWhenToggle=1
let g:undotree_WindowLayout = 4
" NOTE: this will prevent undotree closed then jump to minibufexpl
function! g:CloseUndotree()
call UndotreeHide()
call ex#window#goto_edit_window()
endfunction
function g:Undotree_CustomMap()
if has('gui_running')
nnoremap <silent> <script> <buffer> <ESC> :call g:CloseUndotree()<CR>
else
nnoremap <silent> <script> <buffer> <leader><ESC> :call g:CloseUndotree()<CR>
endif
endfunction
" tabular: invoke by <leader>= alignment-character
" ---------------------------------------------------
Plugin 'godlygeek/tabular'
nnoremap <silent> <leader>= :call g:Tabular(1)<CR>
xnoremap <silent> <leader>= :call g:Tabular(0)<CR>
function! g:Tabular(ignore_range) range
let c = getchar()
let c = nr2char(c)
if a:ignore_range == 0
exec printf('%d,%dTabularize /%s', a:firstline, a:lastline, c)
else
exec printf('Tabularize /%s', c)
endif
endfunction
" vim-easymotion: invoke by <leader><leader> w,b,e,ge,f,F,h,i,j,k,/
" ---------------------------------------------------
Plugin 'Lokaltog/vim-easymotion'
map <leader><leader>/ <Plug>(easymotion-sn)
omap <leader><leader>/ <Plug>(easymotion-tn)
map <leader><leader>j <Plug>(easymotion-j)
map <leader><leader>k <Plug>(easymotion-k)
map <leader><leader>l <Plug>(easymotion-lineforward)
map <leader><leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0 " keep cursor colum when JK motion
" LargeFile
" ---------------------------------------------------
Plugin 'vim-scripts/LargeFile'
let g:LargeFile= 5 " files >= 5MB will use LargeFile rules
"}}}
" DISABLE: I'm using GistBox https://app.gistboxapp.com/ instead
" " gist-vim: Invoke by :Gist
" ---------------------------------------------------
" Plugin 'mattn/webapi-vim'
" Plugin 'mattn/gist-vim'
" c-lang {{{
" ex-cref: invoke by <leader>cr
" ---------------------------------------------------
Plugin 'exvim/ex-cref'
" this is modified for default c syntax highlight settings
" make it don't highlight error pattern
let c_gnu = 1
let c_no_curly_error = 1
let c_no_bracket_error = 1
"}}}
" web {{{
Plugin 'ntpeters/vim-better-whitespace'
nnoremap <unique> <leader>w :StripWhitespace<CR>
" ex-typescript
" ---------------------------------------------------
Plugin 'exvim/ex-typescript'
" emmet-vim
" ---------------------------------------------------
Plugin 'mattn/emmet-vim'
" make sure emmet only enable in html,css files
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
" DISABLE:
" " vim-indent-guides: invoke by <leader>ig
" " ---------------------------------------------------
" Plugin 'nathanaelkane/vim-indent-guides'
" let g:indent_guides_guide_size = 1
" Yggdroot/indentLine: invoke by <leader>ig
" ---------------------------------------------------
Plugin 'Yggdroot/indentLine'
nnoremap <unique> <leader>ig :IndentLinesToggle<CR>
let g:indentLine_showFirstIndentLevel = 1
let g:indentLine_enabled = 0
" vim-javascript
" ---------------------------------------------------
Plugin 'pangloss/vim-javascript'
" vim-coffee-script
" ---------------------------------------------------
Plugin 'kchmck/vim-coffee-script'
" vim-html
" ---------------------------------------------------
Plugin 'exvim/ex-indenthtml.vim'
" DISABLE: Slow to open big css file
" vim-css-color
" ---------------------------------------------------
" Plugin 'skammer/vim-css-color'
" vim-css3-syntax
Plugin 'hail2u/vim-css3-syntax'
" vim-jade
Plugin 'digitaltoad/vim-jade'
" vim-less
" ---------------------------------------------------
Plugin 'groenewege/vim-less'
" vim-stylus
" ---------------------------------------------------
Plugin 'wavded/vim-stylus'
" vim-markdown
" ---------------------------------------------------
Plugin 'plasticboy/vim-markdown'
let g:vim_markdown_initial_foldlevel=9999
"}}}
" TEST {{{
" " test-loading
" echomsg "test-loading: .vimrc"
" Plugin 'exvim/test-loading'
"}}}
" vim:ts=4:sw=4:sts=4 et fdm=marker: