-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vim-plugin.vim
1251 lines (1121 loc) · 51.5 KB
/
.vim-plugin.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
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
" vim: fdm=marker ts=2 sw=2 sts=2 expandtab
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Unite"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
" {{{
" The prefix key.
nnoremap [unite] <Nop>
nmap ; [unite]
cabbrev uba UniteBookmarkAdd
" Unite -vertical -start-insert -winwidth=30 -direction=botright outline
nnoremap <silent> [unite]x :<C-u>Unite output/shellcmd<CR>
nnoremap <silent> [unite]s :<C-u>Unite grep<CR>
nnoremap <silent> [unite]r :<C-u>Unite register -unique<CR>
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir file -start-insert -prompt=> -buffer-name=files<CR>
nnoremap <silent> [unite]; :<C-u>Unite source -prompt=> -start-insert<CR>
nnoremap <silent> [unite]o :<C-u>Unite outline -prompt=> -start-insert<CR>
nnoremap <silent> [unite]b :<C-u>Unite buffer -prompt=> -start-insert<CR>
nnoremap <silent> [unite]j :<C-u>Unite jump -prompt=> -start-insert<CR>
nnoremap <silent> [unite]f :<C-u>Unite buffer file -buffer-name=mixed -prompt=> -start-insert<CR>
nnoremap <silent> [unite]a :<C-u>call UniteSearchRecCall()<CR>
nnoremap <silent> [unite]l :<C-u>Unite file_mru -buffer-name=files_mru -prompt=> -start-insert <CR>
fun! UniteSearchRecCall()
let cmd = 'file_rec/async'
" b:git_dir is from plugin vim-fugitive
if exists('b:git_dir')
let cmd = 'file_rec/git'
endif
exe printf('Unite %s -buffer-name=files -prompt=> -start-insert -unique -ignorecase', cmd)
endf
autocmd FileType unite call s:unite_nice_settings()
function! s:unite_nice_settings()
" Overwrite settings.
imap <buffer> jj <Plug>(unite_insert_leave)
imap <buffer> <C-c> <Plug>(unite_exit)
nmap <buffer> <C-c> <Plug>(unite_exit)
imap <buffer><expr> j unite#smart_map('j', '')
imap <buffer> <TAB> <Plug>(unite_select_next_line)
imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
imap <buffer> ' <Plug>(unite_quick_match_default_action)
nmap <buffer> ' <Plug>(unite_quick_match_default_action)
imap <buffer><expr> x unite#smart_map('x', "\<Plug>(unite_quick_match_choose_action)")
nmap <buffer> x <Plug>(unite_quick_match_choose_action)
nmap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
imap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
imap <buffer> <C-y> <Plug>(unite_narrowing_path)
nmap <buffer> <C-y> <Plug>(unite_narrowing_path)
imap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
nmap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
nmap <buffer> <C-t> <Plug>(unite_toggle_auto_preview)
nmap <buffer> <C-q> <Plug>(unite_print_candidate)
nmap <buffer> <C-X> <Plug>(unite_redraw)
nnoremap <silent><buffer><expr> l
\ unite#smart_map('l', unite#do_action('default'))
let unite = unite#get_current_unite()
if unite.profile_name ==# 'search'
nnoremap <silent><buffer><expr> r unite#do_action('replace')
else
nnoremap <silent><buffer><expr> r unite#do_action('rename')
endif
nnoremap <silent><buffer><expr> cd unite#do_action('lcd')
nnoremap <buffer><expr> S unite#mappings#set_current_filters(
\ empty(unite#mappings#get_current_filters()) ?
\ ['sorter_reverse'] : [])
" Runs "split" action by <C-s>.
imap <silent><buffer><expr> <C-s> unite#do_action('split')
endfunction
" custom menu for unite
let g:unite_source_menu_menus = {}
let g:unite_source_menu_menus.git = {
\ 'description' : ' gestionar repositorios git
\ ⌘ [espacio]g',
\}
let logwatchadded = 'exe "Git! log --follow --diff-filter=A --find-renames=40\\% " input("path:", ".")'
function! MenuGitGremoveConfirm() abort
let sel = confirm("Do You Really Want To RM This File ?", "&y\n&n", 1)
if sel == 1
exe "Gremove"
endif
endfunction
let g:unite_source_menu_menus.git.command_candidates = [
\['▷ gitv browser (Gitv Browser mode) ⌘ ,gv ', 'exe "Gitv"'],
\['▷ gitv browser (Gitv File mode) ⌘ ,ge ', 'exe "Gitv!"'],
\['▷ git log view ⌘ ,gl ', 'GV'],
\['▷ git log view current file ⌘ ,g! ', 'GV!'],
\['▷ git status ⌘ ,gs ', 'Gstatus'],
\['▷ git diff ⌘ ,gd ', 'Gdiff'],
\['▷ git commit ⌘ ,gc ', 'Gcommit'],
\['▷ git blame ⌘ ,gb ', 'Gblame'],
\['▷ git stage ⌘ ,gw ', 'Gwrite'],
\['▷ git checkout ⌘ ,go ', 'Gread'],
\['▷ git rm ⌘ ,gr ', 'exe "call MenuGitGremoveConfirm()"'],
\['▷ git mv ⌘ ,gm ', 'exe "Gmove " input("DESTINO: ")'],
\['▷ git push ⌘ ,gp ', 'Git! push'],
\['▷ git fetch ⌘ ,gf ', 'Git! fetch'],
\['▷ git pull ⌘ ,gx ', 'Git! pull'],
\['▷ git prompt ⌘ ,gi ', 'exe "Git! " input("COMANDO GIT: ")'],
\['▷ git cd ⌘ ,gj ', 'Gcd'],
\['▷ git () add and commmit ⌘ ,gg ', 'exe "Gcommit %"'],
\['▷ git () change last commit message ⌘ ,ga ', 'Gcommit --amend'],
\['▷ git () log show last commit ', 'Git! log -p -1'],
\['▷ git () log show two days commits ', 'Git! log --pretty=oneline --since="2 days ago"'],
\['▷ git () log show what added ', logwatchadded],
\['▷ git () log show current file all commit ', 'Git! log -p -- %'],
\['▷ git () show the repositorios info ', 'Git! remote -v'],
\['▷ git () show remote url ', 'Git! config --get remote.origin.url'],
\['▷ git () show what change ⌘ ,gh ', 'Git! diff HEAD %'],
\['▷ git () show last commit ', 'Git! show %'],
\['▷ git () recover from remote ', 'Git! checkout -- %'],
\['▷ git () revert commit ', 'Git revert HEAD'],
\['▷ git () reset commit (soft) ', 'Git! reset --soft HEAD~1'],
\['▷ git () reset commit (hard) ', 'Git! reset --hard HEAD~1'],
\['▷ git () reset commit (hard) and (clean) cache ', 'Git! reset --hard HEAD~1 && git clean -fd'],
\['▷ git () stash dirty working directory ', 'Git! stash'],
\['▷ git () remove and apply a single stashed state ', 'Git! stash pop'],
\['▷ git () show stash list ', 'Git! stash list'],
\]
nnoremap <silent>[unite]g :Unite -prompt=> -silent -start-insert menu:git<CR>
for item in g:unite_source_menu_menus.git.command_candidates
if stridx(item[0], ',') > -1
let _key = split(item[0], ',')[-1]
let _val = item[1]
exe 'nnoremap <leader>' . _key . ' :' . _val . '<CR>' . (stridx(_val, 'Gcommit') > -1 ? 'i' : '')
endif
endfor
" For ag.
if executable('ag')
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts = '-i --nocolor --follow --nogroup --hidden'
let g:unite_source_grep_recursive_opt = ''
endif
let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '--hidden', '-g', '']
" neovim file_rec
call unite#custom#source('file_rec/neovim', 'matchers', ['converter_relative_word', 'matcher_fuzzy'])
call unite#custom#source('file_rec/neovim', 'sorters', 'sorter_rank')
" wildignore
call unite#custom#source('file,file_rec,file_rec/git,file/async,file_rec/neovim,directory,directory_mru,directory_rec,directory_rec/async',
\ 'ignore_globs',
\ split(&wildignore, ','))
" keymap change
augroup unite_aug
autocmd!
autocmd FileType unite nmap <buffer><expr> <C-s> unite#do_action('split')
autocmd FileType unite nmap <buffer><expr> <C-v> unite#do_action('vsplit')
autocmd FileType unite nmap <buffer> s <Plug>(unite_toggle_mark_current_candidate)
autocmd FileType unite vmap <buffer> s <Plug>(unite_toggle_mark_selected_candidates)
autocmd FileType unite nmap <buffer> <Space> /
autocmd FileType unite nmap <buffer> <C-b> <Plug>(unite_delete_backward_path)
autocmd FileType unite nmap <buffer> <C-y> <Plug>(unite_redraw)
augroup END
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vimfiler"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:vimfiler_as_default_explorer = 1
let g:vimfiler_safe_mode_by_default=0
nnoremap <silent> [unite]vf :<C-u>VimFiler<CR>
nnoremap <silent> [unite]vc :<C-u>VimFilerCurrentDir<CR>
nnoremap <silent> [unite]vb :<C-u>VimFilerBufferDir<CR>
nnoremap <silent> [unite]vd :<C-u>VimFilerDouble<CR>
nnoremap <silent> [unite]ve :<C-u>VimFilerExplorer<CR>
augroup vimfiler_aug
autocmd!
autocmd FileType vimfiler setlocal cursorline
" copy and paste file under cursor fastly
autocmd FileType vimfiler nmap <buffer> F sCcCpr<CR>
autocmd FileType vimfiler nmap <buffer><expr> <C-s> vimfiler#do_switch_action('split')
autocmd FileType vimfiler nmap <buffer><expr> <C-v> vimfiler#do_switch_action('vsplit')
autocmd FileType vimfiler nmap <buffer> <Tab> <Plug>(vimfiler_hide)
autocmd FileType vimfiler nmap <buffer> <C-N> <Plug>(vimfiler_switch_to_another_vimfiler)
autocmd FileType vimfiler nmap <buffer> s <Plug>(vimfiler_toggle_mark_current_line)
autocmd FileType vimfiler vmap <buffer> s <Plug>(vimfiler_toggle_mark_selected_lines)
autocmd FileType vimfiler nmap <buffer> <Space> /
autocmd FileType vimfiler nmap <buffer> <C-b> <Plug>(vimfiler_switch_to_history_directory)
augroup END
" wildignore
let g:vimfiler_ignore_filters = ['matcher_ignore_pattern', 'matcher_ignore_wildignore']
let g:vimfiler_ignore_pattern = ['^\.']
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Gitv"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
autocmd FileType gitv nmap g? :help gitv<CR>:147<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vim-tmux-navigator"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" force everywhere
autocmd BufEnter * nnoremap <silent> <buffer> <C-h> :TmuxNavigateLeft<cr>
autocmd BufEnter * nnoremap <silent> <buffer> <C-j> :TmuxNavigateDown<cr>
autocmd BufEnter * nnoremap <silent> <buffer> <C-k> :TmuxNavigateUp<cr>
autocmd BufEnter * nnoremap <silent> <buffer> <C-l> :TmuxNavigateRight<cr>
autocmd BufEnter * nnoremap <silent> <buffer> <C-\> :TmuxNavigatePrevious<cr>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => tmux-complete.vim"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
let g:tmuxcomplete#trigger = 'omnifunc'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => YouCompleteMe"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
if !has('nvim')
"{{{
" Do not display completion messages
" Patch: https://groups.google.com/forum/#!topic/vim_dev/WeBBjkXE8H8
" set noshowmode
" try
" set shortmess+=c
" catch /^Vim\%((\a\+)\)\=:E539: Illegal character/
" autocmd MyAutoCmd VimEnter *
" \ highlight ModeMsg guifg=bg guibg=bg |
" \ highlight Question guifg=bg guibg=bg
" endtry
"
" Warn: The only supported tag format is the Exuberant Ctags format. The format from "plain" ctags is NOT supported.
" Ctags needs to be called with the --fields=+l option (that's a lowercase L, not a one)
" because YCM needs the language:<lang> field in the tags output
let ycm_collect_identifiers_from_tags_files=1
"Youcompleteme fix
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_python_binary_path = g:python3_host_prog
let ycm_collect_identifiers_from_tags_files=1
let g:ycm_filetype_blacklist = {
\ 'tagbar' : 1, 'qf' : 1, 'notes' : 1, 'markdown' : 1, 'unite' : 1,
\ 'text' : 1, 'vimwiki' : 1, 'pandoc' : 1, 'infolog' : 1, 'mail' : 1,
\ 'vimfiler' : 1, 'gitcommit' : 1, 'leaderf' : 1, 'nerdtree' : 1, 'startify' : 1
\ }
let g:ycm_auto_trigger = 1
let g:ycm_show_diagnostics_ui = 0
" A bug: <C-Space> map for noting, disable it for temprory, because of it trigger one snips completion will be invalid.
let g:ycm_key_invoke_completion = '<C-Space>'
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
let g:ycm_collect_identifiers_from_tags_files=1
let g:ycm_min_num_of_chars_for_completion=2
let g:ycm_cache_omnifunc=0
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_complete_in_strings = 1
let g:ycm_complete_in_comments = 1
let g:ycm_collect_identifiers_from_comments_and_strings = 0
let g:clang_user_options='|| exit 0'
nnoremap ygf :YcmCompleter GoToDeclaration<CR>
nnoremap ygd :YcmCompleter GoToDefinition<CR>
nnoremap ygg :YcmCompleter GoToDefinitionElseDeclaration<CR>
" fixed the <s-tab>
autocmd FileType * inoremap <expr><S-Tab> pumvisible() ? '<Up>' : '<BS>'
" human keymap
inoremap <expr><C-j> pumvisible() ? "\<Down>" : "\<C-j>"
inoremap <expr><C-k> pumvisible() ? "\<Up>" : "\<Esc>S"
inoremap <expr><C-h> pumvisible() ? "\<Esc>a" : "\<C-h>"
"}}}
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => dpoplete.nvim"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
if has('nvim')
"{{{
" Use deoplete.
let g:deoplete#enable_at_startup = 1
" Use smartcase.
let g:deoplete#enable_smart_case = 1
" omnifunc setting
augroup omnifuncs
autocmd!
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
autocmd FileType php setlocal omnifunc=phpcomplete#CompletePHP
augroup end
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
" let C-j C-k do the same thing like C-n C-p if pumvisible
inoremap <expr><C-j> pumvisible() ? "\<C-n>" : "\<C-j>"
inoremap <expr><C-k> pumvisible() ? "\<C-p>" : "\<Esc>S"
inoremap <expr><S-Tab> pumvisible() ? '<C-p>' : '<BS>'
" ,<Tab> for regular tab
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ deoplete#mappings#manual_complete()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function() abort
return deoplete#close_popup() . "\<CR>"
endfunction
call deoplete#custom#set('_', 'matchers', ['matcher_full_fuzzy'])
"}}}
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => deoplete-jedi"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
let g:deoplete#sources#jedi#python_path = g:python3_host_prog
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => airline"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
set laststatus=2
set showtabline=0
set t_Co=256
" let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 0
let g:airline#extensions#buffline#enabled = 1
let g:airline#extensions#tabline#show_tab_type = 1
let g:airline#extensions#tabline#show_splits = 0
let g:airline#extensions#tabline#switch_buffers_and_tabs = 0
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#show_tabs = 0
let g:airline#extensions#tabline#buffer_nr_show = 0
let g:airline#extensions#bufferline#overwrite_variables = 1
let g:airline#extensions#branch#use_vcscommand = 0
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#capslock#enabled = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.branch = '⭠'
let g:airline_symbols.readonly = '⭤'
let g:airline_symbols.linenr = '⭡'
let g:airline_left_sep=''
let g:airline_right_sep=''
if exists('g:colorscheme_already_seted') && g:colorscheme_already_seted == 0
let g:airline_theme="ravenpower"
endif
let g:airline#extensions#tmuxline#enabled = 1
let g:tmuxline_preset = 'righteous'
let g:tmuxline_separators = {
\ 'left' : '',
\ 'left_alt': '',
\ 'right' : '',
\ 'right_alt' : '',
\ 'space' : ' '}
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Tagbar"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:tagbar_width=30
let g:tagbar_autofocus = 1
nnoremap <silent> cot :TagbarToggle<CR>
"}}}
"""""""""""""""""""""""""""z""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => CtrlSF"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:ctrlsf_extra_backend_args = {
\ 'ag': '-i --ignore ".git" --nocolor --follow --nogroup --hidden'
\ }
let g:ctrlsf_mapping = {
\ "next": "n",
\ "prev": "N",
\ "openb": "",
\ "tab": "",
\ "tabb": "",
\ "loclist": "L",
\ "split" : "<C-s>",
\ "vsplit" : "<C-v>",
\ }
nmap <C-F>f <Plug>CtrlSFPrompt
vmap <C-F>f <Plug>CtrlSFVwordPath
vmap <C-F>F <Plug>CtrlSFVwordExec
nmap <C-F>w <Plug>CtrlSFCwordPath
nmap <C-F>p <Plug>CtrlSFPwordPath
nnoremap <silent> <C-F>u :CtrlSFUpdate<CR>
nnoremap <silent> <C-F>o :CtrlSFOpen<CR>
nnoremap <silent> <C-F>t :CtrlSFToggle<CR>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Gundo"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:gundo_prefer_python3 = 1
nnoremap <silent> cog :GundoToggle<CR>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => EasyMotion"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" default map:
" <Leader><Leader>w: motion words after cursor
" <Leader><Leader>s: find words with char
" <Leader><Leader>f: find words with char after cursor
" <Leader><Leader>e: motion words with char after cursor
" map / <Plug>(easymotion-sn)
" omap / <Plug>(easymotion-tn)
" map n <Plug>(easymotion-next)
" map N <Plug>(easymotion-prev)
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
map s <Plug>(easymotion-s)
omap z <Plug>(easymotion-bd-tl)
let g:EasyMotion_startofline = 0 " keep cursor colum when JK motion
let g:EasyMotion_smartcase = 1 " can use '\c' and '\C' after the search keyword to change
function! s:incsearch_config(...) abort
if g:virsual_selection_act == 0
return incsearch#util#deepextend(deepcopy({
\ 'modules': [incsearch#config#easymotion#module({'overwin': 1})],
\ 'keymap': {
\ "\<CR>": '<Over>(easymotion)'
\ },
\ 'is_expr': 0
\ }), get(a:, 1, {}))
endif
endfunction
" incsearch.vim x fuzzy x vim-easymotion
function! s:config_easyfuzzymotion(...) abort
return extend(copy({
\ 'converters': [incsearch#config#fuzzy#converter()],
\ 'modules': [incsearch#config#easymotion#module()],
\ 'keymap': {"\<CR>": '<Over>(easymotion)'},
\ 'is_expr': 0,
\ 'is_stay': 1
\ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> z/ incsearch#go(<SID>config_easyfuzzymotion())
noremap <silent><expr> / incsearch#go(<SID>incsearch_config())
noremap <silent><expr> ? incsearch#go(<SID>incsearch_config({'command': '?'}))
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => snipMate (beside <TAB> support <CTRL-j>)"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" ino <c-j> <c-r>=snipMate#TriggerSnippet()<cr>
" snor <c-j> <esc>i<right><c-r>=snipMate#TriggerSnippet()<cr>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => ultisnips"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
if !has('nvim')
"{{{
" notice: snippets must make sure to be writed right, it will caused to open more then one buffer when you open one file.
" The third part snippets will be autoload as long as VunduleInstall them.
" local snippets can be loaded via g:UltiSnipsSnippetDirectories, and use UltisnipEdit to edit them.
let g:UltiSnipsSnippetDirectories=["~/.vim/snippets"]
let g:UltiSnipsJumpForwardTrigger="<Enter>"
let g:UltiSnipsJumpBackwardTrigger="<C-b>"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" fixed compatible between UltiSnips and YouCompleteMe
" from: http://blog.csdn.net/qq_20336817/article/details/51115411
" help function"{{{
function! g:UltiSnips_Complete()
call UltiSnips#ExpandSnippet()
if g:ulti_expand_res == 0
if pumvisible()
return "\<C-n>"
else
call UltiSnips#JumpForwards()
if g:ulti_jump_forwards_res == 0
return "\<TAB>"
endif
endif
endif
return ""
endfunction
function! g:UltiSnips_Reverse()
call UltiSnips#JumpBackwards()
if g:ulti_jump_backwards_res == 0
return "\<C-P>"
endif
return ""
endfunction
"}}}
if !exists("g:UltiSnipsJumpForwardTrigger")
let g:UltiSnipsJumpForwardTrigger = "<tab>"
endif
if !exists("g:UltiSnipsJumpBackwardTrigger")
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
endif
au InsertEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
au InsertEnter * exec "inoremap <silent> " . g:UltiSnipsJumpBackwardTrigger . " <C-R>=g:UltiSnips_Reverse()<cr>"
"}}}
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => neosnippets"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
if has('nvim')
"{{{
" Plugin key-mappings.
imap <C-g> <Plug>(neosnippet_expand_or_jump)
smap <C-g> <Plug>(neosnippet_expand_or_jump)
xmap <C-g> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
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>"
" For snippet_complete marker.
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/bundle/vim-php-snippets/snippets'
let g:neosnippet#snippets_directory='~/.vim/snippets'
"}}}
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => YankRing"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" <C-n> next yank history
" <c-p> prev yank history
if has("win16") || has("win32")
" Don't do anything
else
let g:yankring_history_dir = '~/.vim/temp_dirs/'
endif
let g:yankring_window_use_bottom = 0
let g:yankring_window_height = 12
map coy :<C-U>YRShow<cr>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vim-multiple-cursors"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" Key 'i' cannot be replayed at 2 cursor locations: press 'v' first to normal mode
let g:multi_cursor_prev_key='<C-d>'
let g:multi_cursor_next_key='<C-s>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
" slow multiple_cursors in YCM
function! Multiple_cursors_before()
if exists('g:ycm_auto_trigger') | let g:ycm_auto_trigger = 0 | endif
if exists('g:deoplete#disable_auto_complete') | let g:deoplete#disable_auto_complete = 1 | endif
endfunction
function! Multiple_cursors_after()
if exists('g:ycm_auto_trigger') | let g:ycm_auto_trigger = 1 | endif
if exists('g:deoplete#disable_auto_complete') | let g:deoplete#disable_auto_complete = 0 | endif
endfunction
" => Tweak MultipleCursorsFind, use default range as paragraph
command! -range -nargs=1 Select call MultiCursorInParagraph(<line1>, <line2>, <q-args>)
function! MultiCursorInParagraph(line1, line2, expr)
if a:line1 == a:line2
let range = GetRangInParagraph()
let s:line1 = range[0]
let s:line2 = range[1]
else
let s:line1 = a:line1
let s:line2 = a:line2
endif
call multiple_cursors#find(s:line1, s:line2, a:expr)
endfunction
" => Select quickly
nmap <M-s> :Select <C-r>=expand("<cword>")<CR><CR>
vmap <M-s> :call VisualSelection('select', '')<CR>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => surround.vim config"{{{
" Annotate strings with gettext http://amix.dk/blog/post/19678
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
vmap Si S(i_<esc>f)
au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Syntastic (syntax checker)"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
" "{{{
" nnoremap coe :SyntasticToggle<CR>
" let g:syntastic_python_checkers=['flake8']
" " let g:syntastic_phpcs_conf = "--standard=/home/hanson/.phpcs-ruleset.xml" " the variable had been invalid.
" let g:syntastic_php_checkers=['php', 'phpmd']
" let g:syntastic_javascript_checkers=['jshint']
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" cabbrev <silent> <buffer> bd lclose\|bdelete
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
" "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => ALE (syntax checker)"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:ale_sign_column_always = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 0
let g:ale_set_highlights = 0
let g:ale_sign_error = '☠'
let g:ale_sign_warning = '⚠'
let g:airline#extensions#ale#enabled = 1
let g:ale_php_phpcs_standard='PSR2 -n'
highlight clear ALEErrorSign
highlight clear ALEWarningSign
nmap <Leader>ck <Plug>(ale_previous_wrap)
nmap <Leader>cj <Plug>(ale_next_wrap)
nmap coe :ALEToggle<CR>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vim-bookmark"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
highlight BookmarkSign ctermbg=NONE ctermfg=gray
highlight BookmarkSign guibg=NONE guifg=#A8A8A8
highlight BookmarkAnnotationSign ctermbg=NONE ctermfg=gray
highlight BookmarkAnnotationSign guibg=NONE guifg=#A8A8A8
highlight BookmarkLineDefault ctermfg=NONE ctermbg=237
highlight BookmarkLineDefault guibg=#3c3d37 gui=NONE
highlight BookmarkAnnotationLine ctermbg=237 ctermfg=NONE
highlight BookmarkAnnotationLine guibg=#3c3d37 guifg=NONE
highlight clear SignColumn
let g:bookmark_save_per_working_dir = 1
let g:bookmark_auto_save = 1
" bookmark sign
let g:bookmark_sign = '⇛'
let g:bookmark_annotation_sign = '⇛'
nmap mgj <Plug>BookmarkMoveUp
nmap mgk <Plug>BookmarkMoveDown
" let g:bookmark_highlight_lines = 1
" let g:bookmark_sign = '♥'
" let g:bookmark_annotation_sign = '⚑'
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Vimroom"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:goyo_width = 120
let g:goyo_margin_top = 2
let g:goyo_margin_bottom = 2
nnoremap <silent> <leader>z :Goyo<cr>
" nnoremap <silent> <leader>z :call GoyoFunc()<cr>
" let g:goyo_toggle_trigger = 0
" function! GoyoFunc()
" if &filetype == "help"
" let g:goyo_width = 100
" endif
" if g:goyo_toggle_trigger == 0
" let g:goyo_showtabline = &showtabline
" endif
" execute 'Goyo'
" if g:goyo_toggle_trigger == 1
" call SetColorScheme()
" let g:goyo_toggle_trigger = 0
" let g:goyo_width = 100
" exec 'set showtabline=' . g:goyo_showtabline
" else
" let g:goyo_toggle_trigger = 1
" endif
" endfunction
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => gvim-fullscreen"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
if has("gui_running")
nmap <F11> <Plug>(fullscreen-toggle)
endif
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vimshell"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" Use current directory as vimshell prompt.
"cabbrev vsh VimShell
"let g:vimshell_prompt_expr = 'escape(fnamemodify(getcwd(), ":~").">", "\\[]()?! ")." "'
"let g:vimshell_prompt_pattern = '^\%(\f\|\\.\)\+> '
"
"" let g:vimshell_user_prompt = 'fnamemodify(getcwd(), ":~")'
""let g:vimshell_right_prompt = 'vcs#info("(%s)-[%b]", "(%s)-[%b|%a]")'
"
"" if has('win32') || has('win64')
"" " Display user name on Windows.
"" let g:vimshell_prompt = $USERNAME."% "
"" else
"" " Display user name on Linux.
"" let g:vimshell_prompt = $USER."% "
"" endif
"
"" Initialize execute file list.
"let g:vimshell_execute_file_list = {}
"call vimshell#set_execute_file('txt,vim,c,h,cpp,d,xml,java', 'vim')
"let g:vimshell_execute_file_list['rb'] = 'ruby'
"let g:vimshell_execute_file_list['pl'] = 'perl'
"let g:vimshell_execute_file_list['py'] = 'python'
"call vimshell#set_execute_file('html,xhtml', 'gexe firefox')
"
"autocmd FileType vimshell
"\ call vimshell#altercmd#define('g', 'git')
"\| call vimshell#altercmd#define('i', 'iexe')
"\| call vimshell#altercmd#define('l', 'll')
"\| call vimshell#altercmd#define('ll', 'ls -l')
"\| call vimshell#hook#add('chpwd', 'my_chpwd', 'MyChpwd')
"
"function! MyChpwd(args, context)
" call vimshell#execute('ls')
"endfunction
"
"autocmd FileType int-* call s:interactive_settings()
"function! s:interactive_settings()
"endfunction
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Trans"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:trans_default_api = 'bing'
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => IndentLine"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
map <Leader>ig :<C-U>IndentLinesToggle<CR>
let g:indentLine_enabled = 0
let g:indentLine_color_term = 239
let g:indentLine_color_gui = '#586e75'
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => tasklist.vim"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:tlTokenList = ["FIXME", "TODO", "HACK", "NOTE", "WARN", "MODIFY", "\" => "]
nnoremap <Leader>td :<C-U>TaskList<CR>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => CamelCaseMotion"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" map <S-W> <Plug>CamelCaseMotion_w
" map <S-B> <Plug>CamelCaseMotion_b
" map <S-E> <Plug>CamelCaseMotion_e
" map <silent> w <Plug>CamelCaseMotion_w
" map <silent> b <Plug>CamelCaseMotion_b
" map <silent> e <Plug>CamelCaseMotion_e
" sunmap w
" sunmap b
" sunmap e
" omap <silent> iw <Plug>CamelCaseMotion_iw
" xmap <silent> iw <Plug>CamelCaseMotion_iw
" omap <silent> ib <Plug>CamelCaseMotion_ib
" xmap <silent> ib <Plug>CamelCaseMotion_ib
" omap <silent> ie <Plug>CamelCaseMotion_ie
" xmap <silent> ie <Plug>CamelCaseMotion_ie
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => fugitive"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" keymap
autocmd FileType gitcommit inoremap <buffer> <silent> <C-c> <Esc>:x!<CR>
autocmd FileType gitcommit nnoremap <buffer> <silent> <C-c> <Esc>:x!<CR>
autocmd BufWinEnter .git/index nmap <buffer> <silent> C <leader>x:Gcommit<CR>i
" autocmd VimLeavePre,BufDelete COMMIT_EDITMSG execute 'sleep 1|bnew|bw'
" How to use it:
" 1. input the short cut and hit the key 'Enter'
" 2. input the short cut and hit the key 'Space'
cabbrev gcm Gcommit -m
cabbrev gcma Gcommit -a -m
cabbrev gcam Gcommit --amend -m
cabbrev gg Git!
cabbrev gs Gstatus
cabbrev ga Git! add
cabbrev gaa Git! add --all
cabbrev gco Git! checkout
cabbrev gbr Git! branch
cabbrev gdl Git! pull origin master
cabbrev gul Git! push -u origin master
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Gitgutter"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:gitgutter_override_sign_column_highlight = 1
let g:gitgutter_max_signs = 1024
autocmd FileType snippets let g:gitgutter_enabled = 0
" autocmd FileType snippets set foldenable!
nmap ms <Plug>GitGutterStageHunk
nmap mr <Plug>GitGutterUndoHunk
nmap mv <Plug>GitGutterPreviewHunk
nmap <silent> mk :call feedkeys("\<Plug>GitGutterPrevHunkzv")<CR>
nmap <silent> mj :call feedkeys("\<Plug>GitGutterNextHunkzv")<CR>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => NERDCommenter"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let NERDSpaceDelims = 1
nmap <Leader>cp vip<plug>NERDCommenterSexy
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Easy-Align"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
vmap ea <Plug>(EasyAlign)
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => toggle.vim"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
imap <silent><C-T> <Plug>ToggleI
nmap <silent><C-T> <Plug>ToggleN
vmap <silent><C-T> <Plug>ToggleV
let g:toggle_pairs = {
\'and':'or',
\'or':'and',
\'if':'unless',
\'unless':'if',
\'elsif':'else',
\'else':'elsif',
\'it':'specify',
\'specify':'it',
\'describe':"context",
\'context':"describe",
\'true':'false',
\'false':'true',
\'yes':'no',
\'no':'yes',
\'on':'off',
\'off':'on',
\'public':'protected',
\'protected':'private',
\'private':'public',
\'&&':'||',
\'||':'&&'
\}
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vim-shell-executor"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:executor_output_win_height = 12
nmap <Leader><Leader>r vip:ExecuteSelection<CR>
nmap <Leader><Leader>rd :bd executor_output<CR>
vmap <Leader><Leader>r :ExecuteSelection<CR>
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vim-instant-markdown"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:instant_markdown_autostart = 0
let g:instant_markdown_slow = 0
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vim-instant-markdown"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
" set conceallevel=2
let g:vim_markdown_conceal = 1
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vimviki"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:vimwiki_list = [ {"path": "~/.vim/.vimwiki/", "path_html": "~/.vim/.vimwikihtml/", "syntax": "markdown", "auto_export": 0} ]
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => phpcomplete.vim"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => phpcomplete-extended"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
let g:phpcomplete_index_composer_command='/usr/local/bin/composer'
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => cscope"{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""}}}
"{{{
function! LoadCscopeDB() abort
if has("cscope")
set csto=1
set cst
set nocsverb
if filereadable("cscope.out")
cs add cscope.out
endif
set csverb
set cscopeverbose
endif
endfunction
au BufEnter * call LoadCscopeDB()
command! LoadCscopeDB call LoadCscopeDB()
nmap <C-c>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>g :cs find g <C-R>=expand("<cword>")<CR><CR>