forked from taohex/navim
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvimrc
1348 lines (1221 loc) · 51.7 KB
/
vimrc
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
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
" detect OS {{{
let s:is_windows = has('win32') || has('win64')
let s:is_cygwin = has('win32unix')
let s:is_macvim = has('gui_macvim')
let s:is_neovim = has('nvim')
"}}}
" nvim settings {{{
if !exists('g:nvim_settings') || !exists('g:nvim_settings.version')
echom 'The g:nvim_settings and g:nvim_settings.version variables must be defined. Please consult the README.'
finish
endif
let s:cache_dir = get(g:nvim_settings, 'cache_dir', '~/.config/nvim/.cache')
if g:nvim_settings.version != 1
echom 'The version number in your shim does not match the distribution version. Please consult the README changelog section.'
finish
endif
" initialize default settings
let s:settings = {}
let s:settings.encoding = 'utf-8'
let s:settings.default_indent = 2
let s:settings.max_column = 120
let s:settings.explorer_plugin = 'nerdtree'
let s:settings.statusline_plugin = 'airline'
let s:settings.enable_cursorcolumn = 0
let s:settings.colorscheme = 'solarized'
let s:settings.autocomplete_plugin = 'none'
if g:nvim_settings.autocomplete != 0
if s:is_neovim && has('python3')
let s:settings.autocomplete_plugin = 'deoplete'
elseif (has('python3') || has('python')) &&
\ filereadable(expand("~/.config/nvim/bundle/repos/github.com/Valloric/YouCompleteMe/third_party/ycmd/ycm_core.so")) &&
\ filereadable(expand("~/.config/nvim/bundle/repos/github.com/Valloric/YouCompleteMe/third_party/ycmd/ycm_client_support.so"))
let s:settings.autocomplete_plugin = 'ycm'
elseif has('lua')
let s:settings.autocomplete_plugin = 'neocomplete'
else
let s:settings.autocomplete_plugin = 'neocomplcache'
endif
endif
let s:settings.powerline_fonts = 0
let s:settings.nerd_fonts = 0
if exists('g:nvim_settings.plugin_groups')
let s:settings.plugin_groups = g:nvim_settings.plugin_groups
else
let s:settings.plugin_groups = []
call add(s:settings.plugin_groups, 'core')
call add(s:settings.plugin_groups, 'web')
call add(s:settings.plugin_groups, 'language')
call add(s:settings.plugin_groups, 'c')
call add(s:settings.plugin_groups, 'javascript')
call add(s:settings.plugin_groups, 'ruby')
call add(s:settings.plugin_groups, 'python')
call add(s:settings.plugin_groups, 'scala')
call add(s:settings.plugin_groups, 'go')
call add(s:settings.plugin_groups, 'scm')
call add(s:settings.plugin_groups, 'editing')
call add(s:settings.plugin_groups, 'indents')
call add(s:settings.plugin_groups, 'navigation')
call add(s:settings.plugin_groups, 'unite')
call add(s:settings.plugin_groups, 'autocomplete')
" call add(s:settings.plugin_groups, 'textobj')
call add(s:settings.plugin_groups, 'misc')
if s:is_windows
call add(s:settings.plugin_groups, 'windows')
endif
" exclude all language-specific plugins by default
if !exists('g:nvim_settings.plugin_groups_exclude')
let g:nvim_settings.plugin_groups_exclude = ['web','javascript','ruby','python','go','scala']
endif
for group in g:nvim_settings.plugin_groups_exclude
let i = index(s:settings.plugin_groups, group)
if i != -1
call remove(s:settings.plugin_groups, i)
endif
endfor
if exists('g:nvim_settings.plugin_groups_include')
for group in g:nvim_settings.plugin_groups_include
call add(s:settings.plugin_groups, group)
endfor
endif
endif
" override defaults with the ones specified in g:nvim_settings
for key in keys(s:settings)
if has_key(g:nvim_settings, key)
let s:settings[key] = g:nvim_settings[key]
endif
endfor
"}}}
" setup & dein {{{
set nocompatible
set all& "reset everything to their defaults
set runtimepath+=~/.config/nvim/bundle/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.config/nvim/bundle'))
call dein#add('Shougo/dein.vim')
call dein#local('~/.config/nvim/bundle_dev')
"}}}
" functions {{{
function! s:get_cache_dir(suffix) "{{{
return resolve(expand(s:cache_dir . '/' . a:suffix))
endfunction "}}}
function! Source(begin, end) "{{{
let lines = getline(a:begin, a:end)
for line in lines
execute line
endfor
endfunction "}}}
function! Preserve(command) "{{{
" preparation: save last search, and cursor position.
let _s = @/
let l = line(".")
let c = col(".")
" do the business:
execute a:command
" clean up: restore previous search history, and cursor position
let @/ = _s
call cursor(l, c)
endfunction "}}}
function! StripTrailingWhitespace() "{{{
call Preserve("%s/\\s\\+$//e")
endfunction "}}}
function! EnsureExists(path) "{{{
if !isdirectory(expand(a:path))
call mkdir(expand(a:path))
endif
endfunction "}}}
function! CloseWindowOrKillBuffer() "{{{
" never bdelete a nerd tree
if matchstr(expand("%"), 'NERD') ==# 'NERD'
wincmd c
return
endif
let number_of_windows_to_this_buffer = len(filter(range(1, winnr('$')), "winbufnr(v:val) == bufnr('%')"))
if number_of_windows_to_this_buffer > 1
wincmd c
else
bdelete
endif
endfunction "}}}
"}}}
" base configuration {{{
set timeoutlen=300 "mapping timeout
set ttimeoutlen=50 "keycode timeout
set mouse=a "enable mouse
set mousehide "hide when characters are typed
set history=1000 "number of command lines to remember
set ttyfast "assume fast terminal connection
set viewoptions=folds,options,cursor,unix,slash "unix/windows compatibility
if exists('$TMUX')
set clipboard=
else
set clipboard=unnamed "sync with OS clipboard
endif
set hidden "allow buffer switching without saving
set autoread "auto reload if file saved externally
set fileformats+=mac "add mac to auto-detection of file format line endings
set nrformats-=octal "always assume decimal numbers
set showcmd
set tags=tags;/
set showfulltag
set modeline
set modelines=5
if s:is_windows && !s:is_cygwin
" ensure correct shell in gvim
set shell=c:\windows\system32\cmd.exe
endif
if $SHELL =~ '/fish$'
" VIM expects to be run from a POSIX shell.
set shell=sh
endif
set noshelltemp "use pipes
" whitespace
set backspace=indent,eol,start "allow backspacing everything in insert mode
set autoindent "automatically indent to match adjacent lines
set expandtab "spaces instead of tabs
set smarttab "use shiftwidth to enter tabs
let &tabstop = s:settings.default_indent "number of spaces per tab for display
let &softtabstop = s:settings.default_indent "number of spaces per tab in insert mode
let &shiftwidth = s:settings.default_indent "number of spaces when indenting
set list "highlight whitespace
set shiftround
set linebreak
set scrolloff=1 "always show content after scroll
set scrolljump=5 "minimum number of lines to scroll
set display+=lastline
set wildmenu "show list for autocomplete
set wildmode=list:full
if (v:version >= 704)
set wildignorecase
endif
set splitbelow
set splitright
" disable sounds
set noerrorbells
set novisualbell
set t_vb=
" searching
set hlsearch "highlight searches
set incsearch "incremental searching
set ignorecase "ignore case for searching
set smartcase "do case-sensitive if there's a capital letter
if executable('ack')
set grepprg=ack\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow\ $*
set grepformat=%f:%l:%c:%m
endif
if executable('ag')
set grepprg=ag\ --nogroup\ --column\ --smart-case\ --nocolor\ --follow
set grepformat=%f:%l:%c:%m
endif
" vim file/folder management {{{
" persistent undo
if exists('+undofile')
set undofile
let &undodir = s:get_cache_dir('undo')
endif
" backups
set backup
let &backupdir = s:get_cache_dir('backup')
" swap files
let &directory = s:get_cache_dir('swap')
set noswapfile
call EnsureExists(s:cache_dir)
call EnsureExists(&undodir)
call EnsureExists(&backupdir)
call EnsureExists(&directory)
"}}}
let mapleader = ','
let g:mapleader = ','
"}}}
" ui configuration {{{
set showmatch "automatically highlight matching braces/brackets/etc.
set matchtime=2 "tens of a second to show matching parentheses
set number
set lazyredraw
set laststatus=2
set noshowmode
set foldenable "enable folds by default
set foldmethod=syntax "fold via syntax of files
set foldlevelstart=99 "open all folds by default
let g:xml_syntax_folding = 1 "enable xml folding
set cursorline
autocmd WinLeave * setlocal nocursorline
autocmd WinEnter * setlocal cursorline
let &colorcolumn = s:settings.max_column
if s:settings.enable_cursorcolumn
set cursorcolumn
autocmd WinLeave * setlocal nocursorcolumn
autocmd WinEnter * setlocal cursorcolumn
endif
if has('gui_running')
" open maximized
set lines=999 columns=9999
if s:is_windows
autocmd GUIEnter * simalt ~x
endif
set guioptions+=t "tear off menu items
set guioptions-=T "toolbar icons
if s:is_macvim
set gfn=Ubuntu_Mono:h14
set transparency=2
endif
if s:is_windows
set gfn=Ubuntu_Mono:h10
endif
if has('gui_gtk')
set gfn=Ubuntu\ Mono\ 11
endif
else
if $COLORTERM ==# 'gnome-terminal'
set t_Co=256 "why you no tell me correct colors?!?!
endif
if $TERM_PROGRAM ==# 'iTerm.app'
" different cursors for insert vs normal mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
endif
endif
"}}}
" plugin/mapping configuration {{{
if count(s:settings.plugin_groups, 'core') "{{{
call dein#add('matchit.zip')
if s:settings.statusline_plugin ==# 'airline' "{{{
"if s:settings.encoding ==# 'utf-8' && has('multi_byte') && has('unix') && &encoding ==# 'utf-8' &&
" \ (empty(&termencoding) || &termencoding ==# 'utf-8') "{{{
call dein#add('vim-airline/vim-airline') "{{{
let g:airline_powerline_fonts = s:settings.powerline_fonts
let g:airline_section_b = ''
let g:airline_section_warning = ''
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '^V' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '^S' : 'S',
\ }
let g:airline#extensions#bufferline#enabled = 0
let g:airline#extensions#bufferline#overwrite_variables = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffers_label = 'b'
let g:airline#extensions#tabline#tabs_label = 't'
let g:airline#extensions#tabline#buffer_nr_show = 1
let g:airline#extensions#tabline#buffer_nr_format = '%s '
let g:airline#extensions#tabline#fnamecollapse = 1
let g:airline#extensions#tabline#fnametruncate = 12
let g:airline#extensions#syntastic#enabled = 1
"}}}
call dein#add('vim-airline/vim-airline-themes')
"endif "}}}
"}}}
elseif s:settings.statusline_plugin ==# 'lightline' "{{{
"call dein#add('zefei/vim-wintabs')
"call dein#add('bling/vim-bufferline') "{{{
" function! LightLineBufferline()
" "if !empty(glob("lightline.vim"))
" if exists('*bufferline#refresh_status')
" call bufferline#refresh_status()
" endif
" let b = g:lightline_buffer_status_info.before
" let c = g:lightline_buffer_status_info.current
" let a = g:lightline_buffer_status_info.after
" return b . c . a
" endfunction
""}}}
call dein#add('itchyny/lightline.vim') "{{{
set showtabline=2 " always show tabline
function! LightlineTag()
" :help tagbar-statusline
let line = tagbar#currenttag('%s', '')
return line
endfunction
function! LightlineSyntastic()
return SyntasticStatuslineFlag()
endfunction
function! LightlineModified()
return &ft =~? 'help' ? '' : &modified ? g:lightline_buffer_modified_icon : &modifiable ? '' : '-'
endfunction
function! LightlineReadonly()
return &ft !~? 'help' && &readonly ? g:lightline_buffer_readonly_icon : ''
endfunction
function! LightlineFugitive()
if exists('*fugitive#head')
let _ = fugitive#head()
return strlen(_) ? g:lightline_buffer_git_icon . _ : ''
endif
return ''
endfunction
function! LightlineFileinfo()
return LightlineFileencoding() . ' ' . LightlineFileformat()
endfunction
function! LightlineFilename()
let fname = expand('%:.')
return fname ==# 'ControlP' ? g:lightline.ctrlp_item :
\ fname ==# '__Tagbar__' ? g:lightline.fname :
\ fname =~# '__Gundo\|NERD_tree' ? '' :
\ &ft ==# 'vimfiler' ? vimfiler#get_status_string() :
\ &ft ==# 'unite' ? unite#get_status_string() :
\ &ft ==# 'vimshell' ? vimshell#get_status_string() :
\ ('' !=# LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ ('' !=# fname ? fname : '[No Name]') .
\ ('' !=# LightlineModified() ? ' ' . LightlineModified() : '')
endfunction
function! LightlineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightlineFiletype()
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
endfunction
function! LightlineFileencoding()
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
endfunction
function! LightlineMode()
let fname = expand('%:t')
return fname ==# '__Tagbar__' ? 'Tagbar' :
\ fname ==# 'ControlP' ? 'CtrlP' :
\ fname ==# '__Gundo__' ? 'Gundo' :
\ fname ==# '__Gundo_Preview__' ? 'Gundo Preview' :
\ fname =~# 'NERD_tree' ? 'NERDTree' :
\ &ft ==# 'unite' ? 'Unite' :
\ &ft ==# 'vimfiler' ? 'VimFiler' :
\ &ft ==# 'vimshell' ? 'VimShell' :
\ winwidth(0) > 60 ? lightline#mode() : ''
endfunction
function! CtrlPMark()
if expand('%:t') =~# 'ControlP'
call lightline#link('iR'[g:lightline.ctrlp_regex])
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item, g:lightline.ctrlp_next], 0)
else
return ''
endif
endfunction
let g:ctrlp_status_func = {
\ 'main': 'CtrlPStatusFunc_1',
\ 'prog': 'CtrlPStatusFunc_2',
\ }
function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
let g:lightline.ctrlp_regex = a:regex
let g:lightline.ctrlp_prev = a:prev
let g:lightline.ctrlp_item = a:item
let g:lightline.ctrlp_next = a:next
return lightline#statusline(0)
endfunction
function! CtrlPStatusFunc_2(str)
return lightline#statusline(0)
endfunction
let g:tagbar_status_func = 'TagbarStatusFunc'
function! TagbarStatusFunc(current, sort, fname, ...) abort
let g:lightline.fname = a:fname
return lightline#statusline(0)
endfunction
augroup AutoSyntastic
autocmd!
autocmd BufWritePost *.c,*.cpp call s:syntastic()
augroup END
function! s:syntastic()
SyntasticCheck
call lightline#update()
endfunction
" disable overwriting the statusline forcibly by other plugins
let g:unite_force_overwrite_statusline = 0
let g:vimfiler_force_overwrite_statusline = 0
let g:vimshell_force_overwrite_statusline = 0
"}}}
call dein#add('taohex/lightline-buffer', {'depends': 'itchyny/lightline.vim'})
if s:settings.colorscheme ==# 'solarized' "{{{
call dein#add('taohex/lightline-solarized', {'depends': 'itchyny/lightline.vim'})
endif "}}}
endif "}}}
call dein#add('tpope/vim-surround')
call dein#add('tpope/vim-repeat')
call dein#add('tpope/vim-dispatch')
call dein#add('tpope/vim-eunuch')
call dein#add('tpope/vim-unimpaired') "{{{
nmap <C-Up> [e
nmap <C-Down> ]e
vmap <C-Up> [egv
vmap <C-Down> ]egv
"}}}
call dein#add('Shougo/vimproc.vim', {'build': 'make'})
call dein#add('skywind3000/asyncrun.vim')
endif "}}}
if count(s:settings.plugin_groups, 'web') "{{{
call dein#add('groenewege/vim-less', {'on_ft': 'less'})
call dein#add('cakebaker/scss-syntax.vim', {'on_ft': ['scss','sass']})
call dein#add('hail2u/vim-css3-syntax', {'on_ft': ['css','scss','sass']})
call dein#add('ap/vim-css-color', {'on_ft': ['css','scss','sass','less','styl']})
call dein#add('othree/html5.vim', {'on_ft': 'html'})
call dein#add('wavded/vim-stylus', {'on_ft': 'styl'})
call dein#add('digitaltoad/vim-jade', {'on_ft': 'jade'})
call dein#add('mustache/vim-mustache-handlebars', {'on_ft': ['mustache','handlebars']})
call dein#add('gregsexton/MatchTag', {'on_ft': ['html','xml']})
call dein#add('mattn/emmet-vim', {'on_ft': ['html','xml','xsl','xslt','xsd','css','sass','scss','less',
\ 'mustache','handlebars']}) "{{{
function! s:zen_html_tab()
if !emmet#isExpandable()
return "\<plug>(emmet-move-next)"
endif
return "\<plug>(emmet-expand-abbr)"
endfunction
autocmd FileType xml,xsl,xslt,xsd,css,sass,scss,less,mustache imap <buffer><Tab> <C-y>,
autocmd FileType html imap <buffer><expr><Tab> <SID>zen_html_tab()
"}}}
endif "}}}
if count(s:settings.plugin_groups, 'language') "{{{
" run `:UpdateTypesFile` to highlight ctags symbols
call dein#add('TagHighlight')
call dein#add('gtags.vim')
call dein#add('gdbmgr')
endif "}}}
if count(s:settings.plugin_groups, 'c') "{{{
call dein#add('a.vim', {'on_ft': ['c','cpp']})
call dein#add('c.vim', {'on_ft': ['c','cpp']})
call dein#add('echofunc.vim', {'on_ft': ['c','cpp']})
call dein#add('STL-improved', {'on_ft': ['c','cpp']})
call dein#add('octol/vim-cpp-enhanced-highlight', {'on_ft': ['c','cpp']})
endif "}}}
if count(s:settings.plugin_groups, 'javascript') "{{{
call dein#add('marijnh/tern_for_vim', {'on_ft': 'javascript', 'build': 'npm install'})
call dein#add('pangloss/vim-javascript', {'on_ft': 'javascript'})
call dein#add('mxw/vim-jsx', {'on_ft': 'javascript'}) "{{{
let g:jsx_ext_required = 0
"let g:jsx_pragma_required = 1
"}}}
call dein#add('maksimr/vim-jsbeautify', {'on_ft': 'javascript'}) "{{{
nnoremap <Leader>fjs :call JsBeautify()<CR>
"}}}
call dein#add('leafgarland/typescript-vim', {'on_ft': 'typescript'})
call dein#add('kchmck/vim-coffee-script', {'on_ft': 'coffee'})
call dein#add('mmalecki/vim-node.js', {'on_ft': 'javascript'})
call dein#add('leshill/vim-json', {'on_ft': ['javascript','json']})
call dein#add('othree/javascript-libraries-syntax.vim', {'on_ft': ['javascript','coffee','ls','typescript']})
endif "}}}
if count(s:settings.plugin_groups, 'ruby') "{{{
call dein#add('tpope/vim-rails')
call dein#add('tpope/vim-bundler')
endif "}}}
if count(s:settings.plugin_groups, 'yachi') "{{{
call dein#add('tommcdo/vim-exchange')
call dein#add('rhysd/clever-f.vim')
call dein#add('ryanoasis/vim-devicons')
call dein#add('sheerun/vim-polyglot')
call dein#add('morhetz/gruvbox')
call dein#add('roxma/vim-paste-easy')
call dein#add('kiteco/vim-plugin')
endif "}}}
if count(s:settings.plugin_groups, 'python') "{{{
call dein#add('klen/python-mode', {'on_ft': 'python'}) "{{{
let g:pymode_rope = 0
"}}}
call dein#add('davidhalter/jedi-vim', {'on_ft': 'python'}) "{{{
let g:jedi#popup_on_dot = 0
"}}}
endif "}}}
if count(s:settings.plugin_groups, 'scala') "{{{
call dein#add('derekwyatt/vim-scala')
call dein#add('megaannum/vimside')
endif "}}}
if count(s:settings.plugin_groups, 'go') "{{{
call dein#add('jnwhiteh/vim-golang', {'on_ft': 'go'})
call dein#add('nsf/gocode', {'on_ft': 'go', 'rtp': 'vim'})
endif "}}}
if count(s:settings.plugin_groups, 'scm') "{{{
if s:settings.encoding ==# 'utf-8' && has('multi_byte') && has('unix') && &encoding ==# 'utf-8' &&
\ (empty(&termencoding) || &termencoding ==# 'utf-8') "{{{
call dein#add('mhinz/vim-signify') "{{{
let g:signify_update_on_bufenter = 0
"}}}
endif "}}}
"if executable('hg')
" call dein#add('bitbucket:ludovicchabant/vim-lawrencium')
"endif
call dein#add('tpope/vim-fugitive') "{{{
nnoremap <silent> <Leader>gs :Gstatus<CR>
nnoremap <silent> <Leader>gd :Gdiff<CR>
nnoremap <silent> <Leader>gc :Gcommit<CR>
nnoremap <silent> <Leader>gb :Gblame<CR>
nnoremap <silent> <Leader>gl :Glog<CR>
nnoremap <silent> <Leader>gp :Git push<CR>
nnoremap <silent> <Leader>gw :Gwrite<CR>
nnoremap <silent> <Leader>gr :Gremove<CR>
autocmd BufReadPost fugitive://* set bufhidden=delete
"}}}
call dein#add('gregsexton/gitv', {'depends': 'tpope/vim-fugitive', 'on_cmd': 'Gitv'}) "{{{
nnoremap <silent> <Leader>gv :Gitv<CR>
nnoremap <silent> <Leader>gV :Gitv!<CR>
"}}}
endif "}}}
if count(s:settings.plugin_groups, 'autocomplete') "{{{
call dein#add('honza/vim-snippets')
if s:settings.autocomplete_plugin ==# 'ycm' "{{{
call dein#add('Valloric/YouCompleteMe') "{{{
"let g:ycm_path_to_python_interpreter='~/local/bin/python'
let g:ycm_complete_in_comments_and_strings = 1
let g:ycm_key_list_select_completion = ['<C-n>','<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>','<Up>']
let g:ycm_filetype_blacklist = {'unite': 1}
"}}}
call dein#add('SirVer/ultisnips') "{{{
let g:UltiSnipsExpandTrigger = "<Tab>"
let g:UltiSnipsJumpForwardTrigger = "<Tab>"
let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>"
let g:UltiSnipsSnippetsDir = '~/.vim/snippets'
"}}}
else
call dein#add('Shougo/neosnippet-snippets')
call dein#add('Shougo/neosnippet.vim') "{{{
let g:neosnippet#snippets_directory = '~/.config/nvim/bundle/vim-snippets/snippets,~/.config/nvim/snippets'
let g:neosnippet#enable_snipmate_compatibility = 1
imap <expr><Tab> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : (pumvisible() ? "\<C-n>" : "\<Tab>")
smap <expr><Tab> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<Tab>"
imap <expr><S-Tab> pumvisible() ? "\<C-p>" : ""
smap <expr><S-Tab> pumvisible() ? "\<C-p>" : ""
"}}}
endif "}}}
if s:settings.autocomplete_plugin ==# 'deoplete' "{{{
call dein#add('Shougo/deoplete.nvim', {'on_i': 1}) "{{{
let g:deoplete#enable_at_startup = 1
"}}}
elseif s:settings.autocomplete_plugin ==# 'neocomplete' "{{{
call dein#add('Shougo/neocomplete.vim', {'on_i': 1}) "{{{
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#data_directory = s:get_cache_dir('neocomplete')
"}}}
elseif s:settings.autocomplete_plugin ==# 'neocomplcache' "{{{
call dein#add('Shougo/neocomplcache.vim', {'on_i': 1}) "{{{
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_temporary_dir = s:get_cache_dir('neocomplcache')
let g:neocomplcache_enable_fuzzy_completion = 1
"}}}
endif "}}}
if s:settings.autocomplete_plugin ==# 'neocomplete' || s:settings.autocomplete_plugin ==# 'neocomplcache' "{{{
call dein#add('osyo-manga/vim-marching', {'on_i': 1}) "{{{
" path to clang command
let g:marching_clang_command = "/usr/bin/clang"
"}}}
call dein#add('Konfekt/FastFold', {'on_i': 1})
endif "}}}
endif "}}}
if count(s:settings.plugin_groups, 'editing') "{{{
call dein#add('editorconfig/editorconfig-vim', {'on_i': 1})
call dein#add('tpope/vim-endwise')
call dein#add('tpope/vim-speeddating')
call dein#add('thinca/vim-visualstar')
call dein#add('tomtom/tcomment_vim')
call dein#add('terryma/vim-expand-region')
call dein#add('terryma/vim-multiple-cursors')
"call dein#add('chrisbra/NrrwRgn')
"call dein#add('godlygeek/tabular', {'on_cmd': 'Tabularize'}) "{{{
" nmap <Leader>a& :Tabularize /&<CR>
" vmap <Leader>a& :Tabularize /&<CR>
" nmap <Leader>a= :Tabularize /=<CR>
" vmap <Leader>a= :Tabularize /=<CR>
" nmap <Leader>a: :Tabularize /:<CR>
" vmap <Leader>a: :Tabularize /:<CR>
" nmap <Leader>a:: :Tabularize /:\zs<CR>
" vmap <Leader>a:: :Tabularize /:\zs<CR>
" nmap <Leader>a, :Tabularize /,<CR>
" vmap <Leader>a, :Tabularize /,<CR>
" nmap <Leader>a<Bar> :Tabularize /<Bar><CR>
" vmap <Leader>a<Bar> :Tabularize /<Bar><CR>
""}}}
call dein#add('jiangmiao/auto-pairs')
call dein#add('justinmk/vim-sneak') "{{{
let g:sneak#streak = 1
"}}}
endif "}}}
if count(s:settings.plugin_groups, 'navigation') "{{{
"call dein#add('yonchu/accelerated-smooth-scroll')
call dein#add('mileszs/ack.vim') "{{{
if executable('ag')
let g:ackprg = "ag --nogroup --column --smart-case --follow"
endif
"}}}
call dein#add('mbbill/undotree', {'on_cmd': 'UndotreeToggle'}) "{{{
let g:undotree_WindowLayout = 2
let g:undotree_SetFocusWhenToggle = 1
nnoremap <silent> <Leader>u :UndotreeToggle<CR>
"}}}
call dein#add('EasyGrep', {'on_cmd': 'GrepOptions'}) "{{{
let g:EasyGrepRecursive = 1
let g:EasyGrepAllOptionsInExplorer = 1
let g:EasyGrepCommand = 1
nnoremap <Leader>vo :GrepOptions<CR>
"}}}
call dein#add('ctrlpvim/ctrlp.vim', {'on_cmd': 'CtrlP'}) "{{{
let g:ctrlp_clear_cache_on_exit = 1
let g:ctrlp_max_height = 40
let g:ctrlp_show_hidden = 0
let g:ctrlp_follow_symlinks = 1
let g:ctrlp_max_files = 20000
let g:ctrlp_cache_dir = s:get_cache_dir('ctrlp')
let g:ctrlp_reuse_window = 'startify'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|idea)$',
\ 'file': '\v\.DS_Store$'
\ }
if executable('rg')
let g:ctrlp_user_command = 'rg --files --no-messages %s ""'
endif
nmap \ [ctrlp]
nnoremap [ctrlp] :CtrlP<CR>
nnoremap [ctrlp]t :CtrlPBufTag<CR>
nnoremap [ctrlp]T :CtrlPTag<CR>
nnoremap [ctrlp]l :CtrlPLine<CR>
nnoremap [ctrlp]b :CtrlPBuffer<CR>
"}}}
if s:settings.explorer_plugin ==# 'nerdtree' "{{{
"if s:settings.encoding == 'utf-8' && has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
" \ (empty(&termencoding) || &termencoding == 'utf-8') "{{{
"call dein#add('scrooloose/nerdtree', {'on_cmd': ['NERDTreeToggle','NERDTreeFind']}) "{{{
call dein#add('scrooloose/nerdtree') "{{{
let g:NERDTreeShowHidden = 1
let g:NERDTreeQuitOnOpen = 0
let g:NERDTreeShowLineNumbers = 0
let g:NERDTreeChDirMode = 0
let g:NERDTreeShowBookmarks = 1
let g:NERDTreeIgnore = ['\.git','\.hg','\.svn','\.DS_Store']
let g:NERDTreeWinPos = 'right'
let g:NERDTreeWinSize = 40
let g:NERDTreeBookmarksFile = s:get_cache_dir('nerdtreebookmarks')
nnoremap <silent> <Leader>n :NERDTreeToggle<CR>
nnoremap <silent> <Leader>nf :NERDTreeFind<CR>
" close vim if the only window left open is a nerdtree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType ==# "primary") | q | endif
"}}}
call dein#add('Xuyuanp/nerdtree-git-plugin') "{{{
"}}}
"endif "}}}
endif "}}}
if s:settings.explorer_plugin ==# 'vimfiler' "{{{
call dein#add('Shougo/vimfiler.vim') "{{{
let g:vimfiler_as_default_explorer = 1
let g:vimfiler_ignore_pattern = '^\%(\.git\|\.hg\|\.svn\|\.DS_Store\)$'
let g:vimfiler_no_default_key_mappings = 1
let g:vimfiler_expand_jump_to_first_child = 0
let g:vimfiler_data_directory = s:get_cache_dir('vimfiler')
nnoremap <silent> <Leader>n :VimFilerExplorer -toggle -winwidth=40 -direction=botright<CR>
nnoremap <silent> <Leader>nf :VimFilerExplorer -find -winwidth=40 -direction=botright<CR>
"nnoremap <silent> <Leader>n :VimFiler -toggle -split -buffer-name=explorer -winwidth=40 -no-quit -direction=botright<CR>
"nnoremap <silent> <Leader>nf :VimFiler -find -toggle -split -buffer-name=explorer -winwidth=40 -no-quit -direction=botright<CR>
function! s:vimfiler_settings() "{{{
set nonumber
execute s:nowait_nmap() 'j' '<Plug>(vimfiler_loop_cursor_down)'
execute s:nowait_nmap() 'k' '<Plug>(vimfiler_loop_cursor_up)'
" Toggle mark.
execute s:nowait_nmap() '<Space>' '<Plug>(vimfiler_toggle_mark_current_line)'
execute s:nowait_nmap() '<S-LeftMouse>' '<Plug>(vimfiler_toggle_mark_current_line)'
execute s:nowait_nmap() '<S-Space>' '<Plug>(vimfiler_toggle_mark_current_line_up)'
vmap <buffer> <Space> <Plug>(vimfiler_toggle_mark_selected_lines)
" Toggle marks in all lines.
execute s:nowait_nmap() '*' '<Plug>(vimfiler_toggle_mark_all_lines)'
execute s:nowait_nmap() '#' '<Plug>(vimfiler_mark_similar_lines)'
" Clear marks in all lines.
execute s:nowait_nmap() 'U' '<Plug>(vimfiler_clear_mark_all_lines)'
" Copy files.
execute s:nowait_nmap() 'c' '<Plug>(vimfiler_copy_file)'
execute s:nowait_nmap() 'Cc' '<Plug>(vimfiler_clipboard_copy_file)'
" Move files.
execute s:nowait_nmap() 'm' '<Plug>(vimfiler_move_file)'
execute s:nowait_nmap() 'Cm' '<Plug>(vimfiler_clipboard_move_file)'
" Delete files.
execute s:nowait_nmap() 'd' '<Plug>(vimfiler_delete_file)'
" Rename.
execute s:nowait_nmap() 'r' '<Plug>(vimfiler_rename_file)'
" Make directory.
execute s:nowait_nmap() 'K' '<Plug>(vimfiler_make_directory)'
" New file.
execute s:nowait_nmap() 'N' '<Plug>(vimfiler_new_file)'
" Paste.
execute s:nowait_nmap() 'Cp' '<Plug>(vimfiler_clipboard_paste)'
" Execute or change directory.
execute s:nowait_nmap() '<Enter>' '<Plug>(vimfiler_cd_or_edit)'
execute s:nowait_nmap() 'o' '<Plug>(vimfiler_expand_or_edit)'
execute s:nowait_nmap() 'l' '<Plug>(vimfiler_smart_l)'
execute s:nowait_nmap() 'x' '<Plug>(vimfiler_execute_system_associated)'
" Move to directory.
execute s:nowait_nmap() 'h' '<Plug>(vimfiler_smart_h)'
execute s:nowait_nmap() 'L' '<Plug>(vimfiler_switch_to_drive)'
execute s:nowait_nmap() '~' '<Plug>(vimfiler_switch_to_home_directory)'
execute s:nowait_nmap() '\' '<Plug>(vimfiler_switch_to_root_directory)'
execute s:nowait_nmap() '&' '<Plug>(vimfiler_switch_to_project_directory)'
execute s:nowait_nmap() '<C-j>' '<Plug>(vimfiler_switch_to_history_directory)'
execute s:nowait_nmap() '<BS>' '<Plug>(vimfiler_switch_to_parent_directory)'
execute s:nowait_nmap() 'gv' '<Plug>(vimfiler_execute_new_gvim)'
execute s:nowait_nmap() '.' '<Plug>(vimfiler_toggle_visible_ignore_files)'
execute s:nowait_nmap() 'H' '<Plug>(vimfiler_popup_shell)'
" Edit file.
execute s:nowait_nmap() 'e' '<Plug>(vimfiler_edit_file)'
execute s:nowait_nmap() 'E' '<Plug>(vimfiler_split_edit_file)'
execute s:nowait_nmap() 'B' '<Plug>(vimfiler_edit_binary_file)'
" Choose action.
execute s:nowait_nmap() 'a' '<Plug>(vimfiler_choose_action)'
" Hide vimfiler.
execute s:nowait_nmap() 'q' '<Plug>(vimfiler_hide)'
" Exit vimfiler.
execute s:nowait_nmap() 'Q' '<Plug>(vimfiler_exit)'
" Close vimfiler.
execute s:nowait_nmap() '-' '<Plug>(vimfiler_close)'
execute s:nowait_nmap() 'ge' '<Plug>(vimfiler_execute_external_filer)'
execute s:nowait_nmap() '<RightMouse>' '<Plug>(vimfiler_execute_external_filer)'
execute s:nowait_nmap() '!' '<Plug>(vimfiler_execute_shell_command)'
execute s:nowait_nmap() 'g?' '<Plug>(vimfiler_help)'
execute s:nowait_nmap() 'v' '<Plug>(vimfiler_preview_file)'
execute s:nowait_nmap() 'O' '<Plug>(vimfiler_sync_with_current_vimfiler)'
execute s:nowait_nmap() 'go' '<Plug>(vimfiler_open_file_in_another_vimfiler)'
execute s:nowait_nmap() '<C-g>' '<Plug>(vimfiler_print_filename)'
execute s:nowait_nmap() 'g<C-g>' '<Plug>(vimfiler_toggle_maximize_window)'
execute s:nowait_nmap() 'yy' '<Plug>(vimfiler_yank_full_path)'
execute s:nowait_nmap() 'M' '<Plug>(vimfiler_set_current_mask)'
execute s:nowait_nmap() 'gr' '<Plug>(vimfiler_grep)'
execute s:nowait_nmap() 'gf' '<Plug>(vimfiler_find)'
execute s:nowait_nmap() 'S' '<Plug>(vimfiler_select_sort_type)'
execute s:nowait_nmap() '<C-v>' '<Plug>(vimfiler_switch_vim_buffer_mode)'
execute s:nowait_nmap() 'gc' '<Plug>(vimfiler_cd_vim_current_dir)'
execute s:nowait_nmap() 'gs' '<Plug>(vimfiler_toggle_safe_mode)'
execute s:nowait_nmap() 'gS' '<Plug>(vimfiler_toggle_simple_mode)'
execute s:nowait_nmap() 'gg' '<Plug>(vimfiler_cursor_top)'
execute s:nowait_nmap() 'G' '<Plug>(vimfiler_cursor_bottom)'
execute s:nowait_nmap() 't' '<Plug>(vimfiler_expand_tree)'
execute s:nowait_nmap() 'T' '<Plug>(vimfiler_expand_tree_recursive)'
execute s:nowait_nmap() 'I' '<Plug>(vimfiler_cd_input_directory)'
execute s:nowait_nmap() '<2-LeftMouse>' '<Plug>(vimfiler_double_click)'
" pushd/popd
execute s:nowait_nmap() 'Y' '<Plug>(vimfiler_pushd)'
execute s:nowait_nmap() 'P' '<Plug>(vimfiler_popd)'
execute s:nowait_nmap() 'gj' '<Plug>(vimfiler_jump_last_child)'
execute s:nowait_nmap() 'gk' '<Plug>(vimfiler_jump_first_child)'
endfunction "}}}
function! s:nowait_nmap() "{{{
return 'nmap <buffer>'
\ . ((v:version > 703 || (v:version == 703 && has('patch1261'))) ?
\ '<nowait>' : '')
endfunction "}}}
autocmd FileType vimfiler call s:vimfiler_settings()
"}}}
endif "}}}
call dein#add('majutsushi/tagbar', {'on_cmd': 'TagbarToggle'}) "{{{
let g:tagbar_left = 1
let g:tagbar_width = 30
let g:tagbar_autoclose = 0
nnoremap <silent> <Leader>t :TagbarToggle<CR>
"}}}
"call dein#add('jeetsukumaran/vim-buffergator') "{{{
" "let g:buffergator_suppress_keymaps = 1
" let g:buffergator_suppress_mru_switch_into_splits_keymaps = 1
" let g:buffergator_viewport_split_policy = "B"
" let g:buffergator_split_size = 10
" let g:buffergator_sort_regime = "mru"
" let g:buffergator_mru_cycle_loop = 0
" "nnoremap <silent> <Leader>b :BuffergatorOpen<CR>
" "nnoremap <silent> <Leader>B :BuffergatorClose<CR>
" "nnoremap <silent> <M-b> :BuffergatorMruCyclePrev<CR>
" "nnoremap <silent> <M-S-b> :BuffergatorMruCycleNext<CR>
" "nnoremap <silent> [b :BuffergatorMruCyclePrev<CR>
" "nnoremap <silent> ]b :BuffergatorMruCycleNext<CR>
""}}}
endif "}}}
if count(s:settings.plugin_groups, 'unite') "{{{
"if has('nvim') || (v:version >= 800) "{{{
"call dein#add('Shougo/denite.nvim') "{{{
"}}}
"else
function! s:on_unite_source() abort
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
call unite#custom#source('file_rec,file_rec/async', 'ignore_pattern',
\ '\.git/\|\.hg/\|\.svn/\|\.tags$\|cscope\.\|\.taghl$\|\.DS_Store$')
call unite#custom#profile('default', 'context', {
\ 'start_insert': 1
\ })
endfunction
"call dein#add('Shougo/unite.vim', {'on_cmd': ['Unite','UniteWithCurrentDir','UniteWithBufferDir',
" \ 'UniteWithProjectDir','UniteWithInput','UniteWithInputDirectory','UniteWithCursorWord']}) "{{{
call dein#add('Shougo/unite.vim', {'hook_post_source': function('s:on_unite_source')}) "{{{
if executable('sift')
let g:unite_source_grep_command = 'sift'
let g:unite_source_grep_default_opts = '-i --no-color'
let g:unite_source_grep_recursive_opt = ''
elseif executable('ag')
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts =
\ '-i --vimgrep --hidden --ignore ''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr'''
let g:unite_source_grep_recursive_opt = ''
elseif executable('pt')
let g:unite_source_grep_command = 'pt'
let g:unite_source_grep_default_opts = '--nogroup --nocolor'
let g:unite_source_grep_recursive_opt = ''
elseif executable('ack')
let g:unite_source_grep_command = 'ack'
let g:unite_source_grep_default_opts = '-i --no-heading --no-color -k -H'
let g:unite_source_grep_recursive_opt = ''
endif
function! s:unite_settings()
nmap <buffer> Q <Plug>(unite_exit)
nmap <buffer> <Esc> <Plug>(unite_exit)
imap <buffer> <Esc> <Plug>(unite_exit)
endfunction
autocmd FileType unite call s:unite_settings()
nmap <Space> [unite]
nnoremap [unite] <Nop>
if s:is_windows
nnoremap <silent> [unite]<Space> :<C-u>Unite -toggle -auto-resize -buffer-name=mixed buffer file:! file_mru bookmark<CR><C-u>
nnoremap <silent> [unite]f :<C-u>Unite -toggle -auto-resize -buffer-name=files file:!<CR><C-u>
else
" -auto-preview
nnoremap <silent> [unite]<Space> :<C-u>Unite -toggle -auto-resize -buffer-name=mixed buffer file/async:! file_mru bookmark<CR><C-u>
nnoremap <silent> [unite]f :<C-u>Unite -toggle -auto-resize -buffer-name=files file/async:!<CR><C-u>
endif
nnoremap <silent> [unite]e :<C-u>Unite -buffer-name=recent file_mru<CR>
nnoremap <silent> [unite]y :<C-u>Unite -buffer-name=yanks history/yank<CR>
nnoremap <silent> [unite]l :<C-u>Unite -auto-resize -buffer-name=line line<CR>
nnoremap <silent> [unite]b :<C-u>Unite -auto-resize -buffer-name=buffers buffer file_mru<CR>
nnoremap <silent> [unite]/ :<C-u>UniteWithCursorWord -no-quit -buffer-name=search grep:.<CR>
nnoremap <silent> [unite]m :<C-u>Unite -auto-resize -buffer-name=mappings mapping<CR>
nnoremap <silent> [unite]s :<C-u>Unite -quick-match buffer<CR>
"}}}
call dein#add('Shougo/neomru.vim', {'depends': 'Shougo/unite.vim'})
"call dein#add('osyo-manga/unite-airline_themes', {'depends': 'Shougo/unite.vim'}) "{{{
" nnoremap <silent> [unite]a :<C-u>Unite -winheight=10 -auto-preview -buffer-name=airline_themes airline_themes<CR>
""}}}
"call dein#add('ujihisa/unite-colorscheme', {'depends': 'Shougo/unite.vim'}) "{{{
" nnoremap <silent> [unite]c :<C-u>Unite -winheight=10 -auto-preview -buffer-name=colorschemes colorscheme<CR>
""}}}
call dein#add('tsukkee/unite-tag', {'depends': 'Shougo/unite.vim'}) "{{{
nnoremap <silent> [unite]t :<C-u>Unite -auto-resize -buffer-name=tag tag tag/file<CR>
"}}}
call dein#add('hewes/unite-gtags', {'depends': 'Shougo/unite.vim'}) "{{{
" lists the references or definitions of a word
" `global --from-here=<location of cursor> -qe <word on cursor>`
nnoremap <silent> [unite]gg :execute 'Unite gtags/context'<CR>
" lists definitions of a word
" `global -qd -e <pattern>`
nnoremap <silent> [unite]gd :execute 'Unite gtags/def:'.expand('<cword>')<CR>
vnoremap <silent> [unite]gd <ESC>:execute 'Unite gtags/def:'.GetVisualSelection()<CR>
" lists references of a word
" `global -qrs -e <pattern>`
nnoremap <silent> [unite]gr :execute 'Unite gtags/ref:'.expand('<cword>')<CR>
vnoremap <silent> [unite]gr <ESC>:execute 'Unite gtags/ref:'.GetVisualSelection()<CR>
" lists grep result of a word
" `global -qg -e <pattern>`
nnoremap <silent> [unite]ge :execute 'Unite gtags/grep:'.expand('<cword>')<CR>
vnoremap <silent> [unite]ge <ESC>:execute 'Unite gtags/grep:'.GetVisualSelection()<CR>