-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.vimrc
1731 lines (1395 loc) · 54.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
"for pathogen {{{
execute pathogen#infect()
execute pathogen#helptags()
"for echofunc
"execute pathogen#infect("after")
"}}}
" for neobundle {{{
" Note: Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
let g:neobundle#install_process_timeout = 1500
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
"NeoBundle 'Valloric/YouCompleteMe', {
"\ 'build' : {
"\ 'mac' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
"\ 'unix' : './install.sh --clang-completer --system-libclang --omnisharp-completer --gocode-completer',
"\ 'windows' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
"\ 'cygwin' : './install.sh --clang-completer --system-libclang --omnisharp-completer'
"\ }
"\ }
NeoBundle 'Shougo/unite.vim'
NeoBundle 'Shougo/neomru.vim'
NeoBundle 'Shougo/unite-outline'
NeoBundle 'hewes/unite-gtags'
NeoBundle 'tsukkee/unite-tag'
NeoBundle 'ujihisa/unite-launch'
NeoBundle 'osyo-manga/unite-filetype'
NeoBundle 'thinca/vim-unite-history'
NeoBundle 'Shougo/neobundle-vim-recipes'
NeoBundle 'Shougo/unite-help'
NeoBundle 'ujihisa/unite-locate'
NeoBundle 'kmnk/vim-unite-giti'
NeoBundle 'ujihisa/unite-font'
NeoBundle 't9md/vim-unite-ack'
NeoBundle 'daisuzu/unite-adb'
NeoBundle 'osyo-manga/unite-airline_themes'
NeoBundle 'mattn/unite-vim_advent-calendar'
NeoBundle 'kannokanno/unite-dwm'
NeoBundle 'raw1z/unite-projects'
NeoBundle 'voi/unite-ctags'
NeoBundle 'Shougo/unite-session'
NeoBundle 'osyo-manga/unite-quickfix'
NeoBundle 'Shougo/vimfiler.vim'
"NeoBundle 'mattn/webapi-vim'
"NeoBundle 'mattn/googlesuggest-complete-vim'
"NeoBundle 'mopp/googlesuggest-source.vim'
NeoBundle 'ujihisa/unite-colorscheme'
NeoBundle 'tacroe/unite-mark'
NeoBundle 'tacroe/unite-alias'
"NeoBundle 'ujihisa/quicklearn'
NeoBundle 'tex/vim-unite-id'
"NeoBundle 'dyng/ctrlsf.vim'
NeoBundle 'vim-scripts/gtags.vim'
NeoBundle 'jiangmiao/auto-pairs'
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'majutsushi/tagbar'
NeoBundle 'Lokaltog/powerline-fonts'
NeoBundle 'bling/vim-airline'
NeoBundle 'jistr/vim-nerdtree-tabs'
NeoBundle 'terryma/vim-multiple-cursors'
NeoBundle 'vim-scripts/L9'
NeoBundle 'itchyny/calendar.vim'
NeoBundle 'twe4ked/vim-diff-toggle'
NeoBundle 'vim-scripts/NERD_tree-Project'
NeoBundle 'rstacruz/sparkup'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'jaromero/vim-monokai-refined'
"NeoBundle 'ianva/vim-youdao-translater'
NeoBundle 'Yggdroot/indentLine'
NeoBundle 'hari-rangarajan/CCTree'
NeoBundle 'vimwiki/vimwiki'
NeoBundle 'paulhybryant/mark'
NeoBundle 'godlygeek/csapprox'
NeoBundle 'john2x/x-marks-the-spot.vim'
NeoBundle 'Twinside/vim-cuteErrorMarker'
NeoBundle 'jeetsukumaran/vim-markology'
NeoBundle 'Shougo/vimshell.vim'
NeoBundle 'vim-scripts/echofunc.vim'
NeoBundle 'vim-scripts/winmanager--Fox'
NeoBundle 'vim-scripts/a.vim'
NeoBundle 'scrooloose/syntastic'
NeoBundle has('lua') ? 'Shougo/neocomplete.vim' : 'Shougo/neocomplcache.vim'
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\ 'windows' : 'tools\\update-dll-mingw',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'linux' : 'make',
\ 'unix' : 'gmake',
\ },
\ }
NeoBundle 'vim-scripts/buftabs'
"set rtp+=~/.vim/bundle/TagHighlight/
"NeoBundle 'https://bitbucket.org/abudden/taghighlight', {'type' : 'hg'}
"NeoBundle 'abudden/taghighlight-automirror'
NeoBundle 'vim-scripts/TagHighlight'
NeoBundle 'vim-scripts/ctags.vim'
NeoBundle 'junkblocker/unite-codesearch'
NeoBundle 'vim-scripts/bufexplorer.zip'
"dos2unix -n plugin/bufexplorer.vim plugin/bufexplorer.vim
NeoBundle 'mbbill/code_complete'
NeoBundle 'Rip-Rip/clang_complete'
NeoBundle 'vim-scripts/lookupfile'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'vim-scripts/c.vim'
NeoBundle 'tpope/vim-characterize'
"NeoBundle 'chrisbra/unicode.vim'
"depend on unite.vim
NeoBundle 'hrsh7th/vim-versions'
NeoBundle 'vim-scripts/LargeFile'
NeoBundle 'airblade/vim-gitgutter'
NeoBundle 'Shougo/tabpagebuffer.vim'
"NeoBundle 'Shougo/neoui'
NeoBundle 'kana/vim-tabpagecd'
NeoBundle 'thinca/vim-ref'
"NeoBundle 'vim-scripts/fcitx.vim'
"NeoBundle 'vim-scripts/The-Mail-Suite-tms'
NeoBundle 'vim-scripts/ZoomWin'
NeoBundle 'Shougo/neosnippet.vim'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'honza/vim-snippets'
NeoBundle 'vim-scripts/DoxygenToolkit.vim'
NeoBundle 'vim-scripts/genutils'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'tyru/open-browser.vim'
NeoBundle 'felixSchl/ctrlp-unity3d-docs'
NeoBundle 'voronkovich/ctrlp-nerdtree.vim'
NeoBundle 'elentok/ctrlp-objects.vim'
NeoBundle 'h14i/vim-ctrlp-buftab'
NeoBundle 'vim-scripts/ctrlp-cmdpalette'
NeoBundle 'mattn/ctrlp-windowselector'
NeoBundle 'the9ball/ctrlp-gtags'
NeoBundle 'thiderman/ctrlp-project'
NeoBundle 'mattn/ctrlp-google'
NeoBundle 'ompugao/ctrlp-history'
NeoBundle 'pielgrzym/ctrlp-sessions'
NeoBundle 'tacahiroy/ctrlp-funky'
NeoBundle 'brookhong/k.vim'
NeoBundle 'mattn/ctrlp-launcher'
NeoBundle 'sgur/ctrlp-extensions.vim'
NeoBundle 'FelikZ/ctrlp-py-matcher'
NeoBundle 'JazzCore/ctrlp-cmatcher'
NeoBundle 'tpope/vim-scriptease'
NeoBundle 'marius/unite-fasd'
NeoBundle 'tomtom/tlib_vim'
NeoBundle 'amiorin/vim-fasd'
NeoBundle 'vim-scripts/ctrlp-z'
NeoBundle 'jceb/vim-orgmode'
NeoBundle 'vim-scripts/utl.vim'
NeoBundle 'vim-scripts/calendar.vim--Matsumoto'
NeoBundle 'tpope/vim-repeat'
NeoBundle 'vim-scripts/taglist.vim'
NeoBundle 'tpope/vim-speeddating'
NeoBundle 'chrisbra/NrrwRgn'
NeoBundle 'vim-scripts/SyntaxRange'
NeoBundle 'Lokaltog/vim-easymotion'
NeoBundle 'godlygeek/tabular'
NeoBundle 'plasticboy/vim-markdown'
NeoBundle 'ashisha/image.vim'
NeoBundle 'chrisbra/vim-diff-enhanced'
NeoBundle 'gmarik/Vundle.vim'
" My Bundles here:
" Refer to |:NeoBundle-examples|.
" Note: You don't set neobundle setting in .gvimrc!
call neobundle#end()
" Required:
" Enable file type detection.
filetype plugin indent on
" Syntax highlighting.
syntax on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
"}}}
" Vundle.vim {{{
set nocompatible " be iMproved, required
filetype off " required
" Setup RTP:
let s:vimfiles = ""
if has("win32") || has("win64")
let s:vimfiles = "$VIM/vimfiles/"
else
let s:vimfiles = "~/.vim/"
endif
" set the runtime path to include Vundle and initialize
let &runtimepath .= ',' . expand(s:vimfiles . "bundle/Vundle.vim/")
"set rtp+=~/.vim/bundle/Vundle.vim
"call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
call vundle#begin(expand(s:vimfiles . "bundle/"))
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
"Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
"Plugin 'user/L9', {'name': 'newL9'}
Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"}}} end Vundle.vim
" Setting colorscheme
"color mycolor
"color desert
colo adrian
"vim paste {{{
set clipboard=unnamed
set pastetoggle=<F4>
"}}}
"set guifont=Courier\ New\ 14
set guifont=Inconsolata\ for\ Powerline\ 14
set tags=tags
"set autochdir
set t_Co=256
"command -range=%chen :ConqueTermSplit bash
set list
set listchars=tab:>-,trail:-
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
set ts=4
set expandtab
" Set mapleader
let mapleader=","
"set backspace=indent,eol,start
" for qt-cppcomplete, added by LiaoLiang Nov28,2008
"set tags+=/opt/qtsdk-2010.05/tags
"set tags+=/home/linux/linux-2.6.35/tags
"set tags+=/usr/include/tags
"set tags+=/home/badwtg1111/ortp-0.20.0/tags
"set tags+=/home/badwtg1111/oss-devel/tags
"set tags+=/home/badwtg1111/glibc-2.16.0/tags
"set tags+=/usr/include/c++/tags
"set tags+=/home/badwtg1111/cpp
"
set tags+=/home/chenchunsheng/qc4.4_20140513/packages/tags
set tags+=/home/chenchunsheng/qc4.4_20140513/development/tags
"set tags+=/home/chenchunsheng/workdir/test_tiff/jni/tags
" for qc4.4
set tags+=/home/chenchunsheng/qc4.4_20140513/vendor/tags
set tags+=/home/chenchunsheng/qc4.4_20140513/frameworks/tags
set tags+=/home/chenchunsheng/qc4.4_20140513/system/tags
set tags+=/home/chenchunsheng/qc4.4_20140513/external/tags
set tags+=/home/chenchunsheng/qc4.4_20140513/hardware/tags
set tags+=/home/chenchunsheng/workdir/mysql/tags
set tags+=/home/chenchunsheng/workdir/mysql-5.6.22/tags
" for lte-mol
"set tags+=/home/chenchunsheng/lte-mol/frameworks/tags
"set tags+=/home/chenchunsheng/lte-mol/vendor/tags
"for cscope {{{
if has("cscope") && filereadable("/usr/bin/cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out $PROJ
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB $PROJ
endif
set csverb
endif
"cscope设置
"set cscopequickfix=s-,c-,d-,i-,t-,e-
"nmap s :cs find s =expand("")
" :cw "查找声明
"nmap g :cs find g =expand("")
":cw "查找定义
"nmap c :cs find c =expand("")
":cw "查找调用
"nmap t :cs find t =expand("") :cw
"查找指定的字符串
"nmap e :cs find e =expand("")
":cw "查找egrep模式,相当于egrep功能,但查找速度快多了
"nmap f :cs find f =expand("")
":cw "查找文件
"nmap i :cs find i ^=expand("")$
":cw "查找包含本文件的文件
"nmap d :cs find d =expand("")
":cw "查找本函数调用的函数
nmap <leader>sa :cs add cscope.out<cr>
nmap <leader>sq :cs add $CSCOPE_DB $PROJ<cr>
nmap <leader>sba :cs add /home/chenchunsheng/qc4.4_20140513/packages/cscope.out /home/chenchunsheng/qc4.4_20140513/packages <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/development/cscope.out /home/chenchunsheng/qc4.4_20140513/development <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/vendor/cscope.out /home/chenchunsheng/qc4.4_20140513/vendor <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/external/cscope.out /home/chenchunsheng/qc4.4_20140513/external <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/frameworks/cscope.out /home/chenchunsheng/qc4.4_20140513/frameworks <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/system/cscope.out /home/chenchunsheng/qc4.4_20140513/system <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/hardware/cscope.out /home/chenchunsheng/qc4.4_20140513/hardware <cr>
\:cs add /home/chenchunsheng/workdir/mysql/cscope.out /home/chenchunsheng/workdir/mysql <cr>
\:cs add /home/chenchunsheng/workdir/mysql-5.6.22/cscope.out /home/chenchunsheng/workdir/mysql-5.6.22 <cr>
nmap <leader>sbb :cs add /home/chenchunsheng/qc4.4_20140513/packages/cscope.out /home/chenchunsheng/qc4.4_20140513/packages <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/development/cscope.out /home/chenchunsheng/qc4.4_20140513/development <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/vendor/cscope.out /home/chenchunsheng/qc4.4_20140513/vendor <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/external/cscope.out /home/chenchunsheng/qc4.4_20140513/external <cr>
\:cs add /home/chenchunsheng/t2_20150302/frameworks/cscope.out /home/chenchunsheng/t2_20150302/frameworks <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/system/cscope.out /home/chenchunsheng/qc4.4_20140513/system <cr>
\:cs add /home/chenchunsheng/qc4.4_20140513/hardware/cscope.out /home/chenchunsheng/qc4.4_20140513/hardware <cr>
\:cs add /home/chenchunsheng/workdir/mysql/cscope.out /home/chenchunsheng/workdir/mysql <cr>
\:cs add /home/chenchunsheng/workdir/mysql-5.6.22/cscope.out /home/chenchunsheng/workdir/mysql-5.6.22 <cr>
nmap <leader>sm :cs show<cr>
nmap <leader>ss :cs find s <C-R>=expand("<cword>")<cr><cr>
nmap <leader>sg :cs find g <C-R>=expand("<cword>")<cr><cr>
nmap <leader>sc :cs find c <C-R>=expand("<cword>")<cr><cr>
nmap <leader>st :cs find t <C-R>=expand("<cword>")<cr><cr>
nmap <leader>se :cs find e <C-R>=expand("<cword>")<cr><cr>
nmap <leader>sf :cs find f <C-R>=expand("<cfile>")<cr><cr>
nmap <leader>si :cs find i <C-R>=expand("<cfile>")<cr><cr>
nmap <leader>sd :cs find d <C-R>=expand("<cword>")<cr><cr>
nmap <F12> :call RunShell("Generate cscope", "cscope -Rb")<cr>:cs add cscope.out<cr>
"for qc4.4
"cs add /home/chenchunsheng/qc4.4_20140513/packages/cscope.out /home/chenchunsheng/qc4.4_20140513/packages
"cs add /home/chenchunsheng/qc4.4_20140513/development/cscope.out /home/chenchunsheng/qc4.4_20140513/development
"cs add /home/chenchunsheng/qc4.4_20140513/vendor/cscope.out /home/chenchunsheng/qc4.4_20140513/vendor
"cs add /home/chenchunsheng/qc4.4_20140513/external/cscope.out /home/chenchunsheng/qc4.4_20140513/external
"cs add /home/chenchunsheng/qc4.4_20140513/frameworks/cscope.out /home/chenchunsheng/qc4.4_20140513/frameworks
"
"cs add /home/chenchunsheng/workdir/test_tiff/jni/cscope.out /home/chenchunsheng/workdir/test_tiff/jni
" for lte
"cs add /home/chenchunsheng/lte-mol/frameworks/cscope.out /home/chenchunsheng/lte-mol/frameworks
"cs add /home/chenchunsheng/lte-mol/vendor/cscope.out /home/chenchunsheng/lte-mol/vendor
"}}}
" for the minibufexplpp
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
" for supertab, added by LiaoLiang Nov28,2008
let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType=""
"插件项目窗口宽度. 默认值: 24
let g:proj_window_width=20
"当按空格键 <space> 或者单击鼠标左键/<LeftMouse>时项目窗口宽度增加量,默认值:100
let g:proj_window_increment=90
let g:proj_flags='i'
"当选择打开一个文件时会在命令行显示文件名和当前工作路径.
let g:proj_flags='m'
"在常规模式下开启 |CTRL-W_o| 和|CTRL-W_CTRL_O| 映射, 使得当前缓冲区成为唯一可
" 见的缓冲区, 但是项目窗口仍然可见.
let g:proj_flags='s' "开启语法高亮.
let g:proj_flags='t' "用按 <space> 进行窗口加宽.
let g:proj_flags='c' "设置后, 在项目窗口中打开文件后会自动关闭项目窗口.
let g:proj_flags='F' "显示浮动项目窗口. 关闭窗口的自动调整大小和窗口替换.
let g:proj_flags='L' "自动根据CD设置切换目录.
let g:proj_flags='n' "显示行号.
let g:proj_flags='S' "启用排序.
let g:proj_flags='T' "子项目的折叠在更新时会紧跟在当前折叠下方显示(而不是其底部).
let g:proj_flags='v' "设置后将, 按 /G 搜索时用 :vimgrep 取代 :grep.
let g:proj_run1='!p4 edit %f' "g:proj_run1 ... g:proj_run9 用法.
let g:proj_run3='silent !gvim %f'
let Tlist_Ctags_Cmd='/usr/bin/ctags'
let Tlist_Show_One_File=1
let Tlist_OnlyWindow=1
let Tlist_Use_Right_Window=0
let Tlist_Sort_Type='name'
let Tlist_Exit_OnlyWindow=1
let Tlist_Show_Menu=1
let Tlist_Max_Submenu_Items=10
let Tlist_Max_Tag_length=20
let Tlist_Use_SingleClick=0
let Tlist_Auto_Open=0
let Tlist_Close_On_Select=0
let Tlist_File_Fold_Auto_Close=1
let Tlist_GainFocus_On_ToggleOpen=0
let Tlist_Process_File_Always=1
let Tlist_WinHeight=10
let Tlist_WinWidth=18
let Tlist_Use_Horiz_Window=0
" for omnicppcomplete, added by LiaoLiang Nov28,2008
set nocp
let OmniCpp_DefaultNamespaces = ["std"]
filetype plugin on
" :help omnicppcomplete
set completeopt=longest,menu " I really HATE the preview window!!!
let OmniCpp_NameSpaceSearch=1 " 0: namespaces disabled
" 1: search namespaces in the current buffer [default]
" 2: search namespaces in the current buffer and in included files
let OmniCpp_GlobalScopeSearch=1 " 0: disabled 1:enabled
let OmniCpp_ShowAccess=1 " 1: show access
let OmniCpp_ShowPrototypeInAbbr=1 " 1: display prototype in abbreviation
let OmniCpp_MayCompleteArrow=1 " autocomplete after ->
let OmniCpp_MayCompleteDot=1 " autocomplete after .
let OmniCpp_MayCompleteScope=1 " autocomplete after ::
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
"for autocomplpop
let g:AutoComplPop_MappingDriven = 1
let g:pumselect = 0
inoremap <expr> <TAB> MaySelect()
function MaySelect()
if(pumvisible())
let g:pumselect = 1
return "\<DOWN>"
endif
return "\<TAB>"
endfunc
inoremap <expr> <Space> MayComplete()
func MayComplete()
if (pumvisible() && g:pumselect)
let g:pumselect = 0
return "\<CR>"
endif
return "\<Space>"
endfunc
"inoremap <expr> <CR> StateChangeEnter()
"func StateChangeEnter()
"let g:pumselect = 0
"return "\<CR>"
"endfunc
let g:winManagerWindowLayout='FileExplorer|Tagbar'
nmap wm :WMToggle<cr>
" .vimrc - Vim configuration file.
"
" Copyright (c) 2010 Jeffy Du. All Rights Reserved.
"
" Maintainer: Jeffy Du <[email protected]>
" Created: 2010-01-01
" LastChange: 2010-04-22
" GENERAL SETTINGS: {{{
" To use VIM settings, out of VI compatible mode.
set nocompatible
" Other settings.
set autoindent
set autoread
set autowrite
set background=dark
set backspace=indent,eol,start
set softtabstop=4
set nobackup
set cindent
set cinoptions=:0
set cursorline
set completeopt=longest,menuone
set expandtab
set fileencodings=utf-8,gb2312,gbk,gb18030
set fileformat=unix
set foldenable
set foldmethod=manual
set guioptions-=T
set guioptions-=m
set guioptions-=r
set guioptions-=l
set helpheight=10
set helplang=cn
set hidden
set history=100
set hlsearch
set ignorecase
set incsearch
set mouse=a
set number
set pumheight=10
set ruler
set scrolloff=5
set shiftwidth=4
set showcmd
set smartindent
set smartcase
set tabstop=4
set termencoding=utf-8
set textwidth=80
set whichwrap=h,l
set wildignore=*.bak,*.o,*.e,*~
set wildmenu
set wildmode=list:longest,full
set nowrap
"}}}
" AUTO COMMANDS: {{{1
" auto expand tab to blanks
"autocmd FileType c,cpp set expandtab
" Restore the last quit position when open file.
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
" PLUGIN SETTINGS: {{{1
" taglist.vim
let g:Tlist_Auto_Update=1
let g:Tlist_Process_File_Always=1
let g:Tlist_Exit_OnlyWindow=1
let g:Tlist_Show_One_File=1
let g:Tlist_WinWidth=25
let g:Tlist_Enable_Fold_Column=0
let g:Tlist_Auto_Highlight_Tag=1
" OmniCppComplete.vim
let g:OmniCpp_DefaultNamespaces=["std"]
let g:OmniCpp_MayCompleteScope=1
let g:OmniCpp_SelectFirstItem=2
" VimGDB.vim
if has("gdb")
set asm=0
let g:vimgdb_debug_file=""
run macros/gdb_mappings.vim
endif
" plugin shortcuts
function! RunShell(Msg, Shell)
echo a:Msg . '...'
call system(a:Shell)
echon 'done'
endfunction
"nmap <F4> :TlistToggle<cr>
nnoremap <silent> <F2> :TagbarToggle<CR>
"nnoremap <Leader>t :TagbarToggle<CR>
let g:tagbar_left = 1
"nmap <F5> :MRU<cr>
nmap <F6> :vimgrep /<C-R>=expand("<cword>")<cr>/ **/*.c **/*.h<cr><C-o>:cw<cr>
nmap <F9> :call RunShell("Generate tags", "ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .")<cr>
nmap <F10> :call HLUDSync()<cr>
nmap <F11> :call RunShell("Generate filename tags", "~/.vim/shell/genfiletags.sh")<cr>
nnoremap <silent> <leader>g :Grep<CR>
nmap <leader>gs :GetScripts<cr>
"for airline {{{
"Powerline
"let g:Powerline_symbols = 'unicode'
set laststatus=2 " Always show the statusline
"let g:Powerline_symbols_override = {
"\ 'BRANCH': [0x2213],
"\ 'LINE': 'L',
"\ }
"let g:Powerline_dividers_override = ['>>', '>', '<<', '<']
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
"function! AccentDemo()
"let keys = ['dec:', '%b', 'hex:0x', '%B']
"for k in keys
"call airline#parts#define_text(k, k)
"call airline#parts#define_accent(k, 'green')
"endfor
"let g:airline_section_w = airline#section#create(keys)
"endfunction
"autocmd VimEnter * call AccentDemo()
let g:airline#extensions#tagbar#enabled = 1
let g:airline#extensions#tagbar#flags = 's'
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#bufferline#enabled = 1
function! MyOverride(...)
call airline#parts#define_accent('Title', 'green')
call a:1.add_section('Title','dec:%b hex:0x%B ')
endfunction
call airline#add_statusline_func('MyOverride')
"}}}
" NERDTree.vim {{{
let g:NERDTreeMouseMode=2
let g:NERDTreeAutoCenter=1
let g:NERDTreeWinPos="left"
let g:NERDTreeWinSize=25
let g:NERDTreeShowLineNumbers=1
let g:NERDTreeQuitOnOpen=0
let g:NERDTreeShowHidden=1
nmap <F3> :ToggleNERDTree<cr>
"let NERDTreeWinPos='left'
"nnoremap <silent> <leader>f :NERDTreeFind<CR>
let g:NTPNames = ['.git','build.xml', 'Makefile', '.project', '.lvimrc','Android.mk']
let g:NTPNames = add(g:NTPNames, 'SConstruct')
call extend(g:NTPNames, ['*.sln', '*.csproj'])
map <Leader>nn <plug>NERDTreeTabsToggle<CR>
"set rtp+=~/.vim/bundle/NERD_tree-Project
"let g:NTPNames = add(g:NTPNames, 'SConstruct')
"let g:NTPNames = add(g:NTPNames, '.git')
"extend(g:NTPNames, ['*.sln', '*.csproj','.git','.project','SConstruct'])
"}}}
" If you like control + arrow key to navigate windows
" then perform the remapping
"
noremap <C-Down> <C-W>j
noremap <C-Up> <C-W>k
noremap <C-Left> <C-W>h
noremap <C-Right> <C-W>l
nmap <leader>zz <C-w>o
nmap <silent> <Leader>P <Plug>ToggleProject
nmap <silent> <leader>cd :exe 'cd ' . OpenDir<cr>:pwd<cr>
nmap <leader>lv :lv /<c-r>=expand("<cword>")<cr>/ %<cr>:lw<cr>
" If you like <C-TAB> and <C-S-TAB> to switch buffers
" in the current window then perform the remapping
"minibufexpl {{{
map <Leader>mbe :MBEOpen<cr>
map <Leader>mbc :MBEClose<cr>
map <Leader>mbt :MBEToggle<cr>
noremap <Leader>n1 :MBEbn<CR>
noremap <Leader>p :MBEbp<CR>
"}}}
""youdao {{{
"vnoremap <silent> <leader>ydv <Esc>:Ydv<CR>
"nnoremap <silent> <leader>ydc <Esc>:Ydc<CR>
"noremap <leader>yd :Yde<CR>
""}}}
"for indentLine {{{
let g:indentLine_color_term = 112
"}}}
" cctree highlight setting {{{
highlight CCTreeHiSymbol gui=bold guifg=yellow guibg=darkblue ctermfg=yellow ctermbg=darkblue
highlight CCTreeHiMarkers gui=bold guifg=yellow guibg=darkblue ctermfg=yellow ctermbg=darkblue
highlight Ignore ctermfg=black guifg=bg
" cctree cscopedb
let g:CCTreeCscopeDb = "cscope.out"
" 设置这个之后在敲完命令 CCTreeLoadDB 之后回车就会自动选上 cscope.out
" set updatetime
set updatetime=0
" 设置这个之后,光标移动时,CCTree-Preview 里面的内容才会实时进行语法加亮
"本来以为设置完 updatetime 就可以很方便的使用 CCTree 了,这时发现,一旦设置了 updatetime,当 CCTree-Preview 里面的内容被加亮之后,
"就无法使用 CCTreeLoadBufferUsingTag(快捷键为 <CR>,即回车)这个命令了,但仍旧可以使用 CCTreePreviewBufferUsingTag(快捷键为 <Ctrl+p>)。
"查看 cctree.vim 后发现,函数 s:CCTreeLoadBufferFromKeyword 和 s:CCTreePreviewBufferFromKeyword 在调用函数 s:CCTreeGetCurrentKeyword 上
"有些不同。在将 s:CCTreeLoadBufferFromKeyword 中的调用方式改成和 s:CCTreePreviewBufferFromKeyword 的一样后,就可以在 CCTree-Preview 里正常使用回车进行跳转了。
"修改方式如下:
"将位于function! s:CCTreeLoadBufferFromKeyword中的
"if s:CCTreeGetXCurrentKeyworkd() == -1
"return
"endif
"替换成
"call s:CCTreeGetCurrentKeyword()
"if s:CCTreekeyword == ''
"return
"endif
"大功告成!
"CCtree.Vim C Call-Tree Explorer 源码浏览工具关系树(赞)"{{{
"1. 除了cscope ctags 程序的安装, 还需安装强力胶ccglue(ctags-cscope glue): http://sourceforge.net/projects/ccglue/files/src/
" (1) ./configure && make && make install (或直接下载ccglue放到/bin中
" (2) $ccglue -S cscope.out -o cctree.out 或$ccglue -S cscope1.out cscope2.out -o cctree.out"
" (3) :CCTreeLoadXRefDBFromDisk cctree.out
"2. 映射快捷键(上面F1) 其中$CCTREE_DB是环境变量,写在~/.bashrc中"
" map <F1> :CCTreeLoadXRefDBFromDisk $CCTREE_DB<CR>"
" eg.
" export CSCOPE_DB=/home/tags/cscope.out
" export CCTREE_DB=/home/tags/cctree.out
" export MYTAGS_DB=/home/tags/tags
"注: 如果没有装ccglue ( 麻烦且快捷键不好设置, 都用完了)
"map <leader>ctl :CCTreeLoadDB $CSCOPE_DB<CR>
"这样加载有点慢, cscope.out cctree.out存放的格式不同
"map <leader>xxx :CCTreeAppendDB $CSCOPE_DB2<CR>
"追加另一个库"
"map <leader>xxx :CCTreSaveXRefDB $CSCOPE_DB<CR>
"格式转化xref格式
"map <leader>xxx :CCTreeLoadXRefDB $CSCOPE_DB<CR>
"加载xref 格式的库(或者如下)"
"map <leader>xxx :CCTreeLoadXRefDBFromDisk $CSCOPE_DB<CR>
"加载xref格式的库"
"map <leader>xxx :CCTreeUnLoadDB
"卸载所有的数据库"
"
"3. 设置
"let g:CCTreeDisplayMode = 3 " 当设置为垂直显示时, 模式为3最合适. (1-minimum width, 2-little space, 3-witde)
"let g:CCTreeWindowVertical = 0 " 水平分割,垂直显示
"let g:CCTreeWindowMinWidth = 40 " 最小窗口
"let g:CCTreeUseUTF8Symbols = 1 " 为了在终端模式下显示符号
"g:CCTreeKeyToggleWindow = '<C-\>w' "打开关闭窗口
"let g:CCTreeHilightCallTree = 0 " 去掉高亮, 太耀眼.
"默认设置:
" g:CCTreeKeyTraceForwardTree = '<C-\>>' "该函数调用其他函数
" g:CCTreeKeyTraceReverseTree = '<C-\><' "该函数被谁调用
" g:CCTreeKeyHilightTree = '<C-l>' " Static highlighting
" g:CCTreeKeySaveWindow = '<C-\>y'"
" g:CCTreeKeyToggleWindow = '<C-\>w'
" g:CCTreeKeyCompressTree = 'zs' " Compress call-tree
" g:CCTreeKeyDepthPlus = '<C-\>='"
" g:CCTreeKeyDepthMinus = '<C-\>-'
"CCtree.Vim C Call-Tree Explorer 源码浏览工具关系树(赞)"}}}
"}}}
"x-marks-the-spot {{{
"nmap <unique> <C-BS> <Plug>XmarksthespotNextmark
"}}}
"for neocomplete {{{
"Note: This option must set it in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return neocomplete#close_popup() . "\<CR>"
" For no inserting <CR> key.
"return pumvisible() ? neocomplete#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup()
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? neocomplete#close_popup() : "\<Space>"
" For cursor moving in insert mode(Not recommended)
"inoremap <expr><Left> neocomplete#close_popup() . "\<Left>"
"inoremap <expr><Right> neocomplete#close_popup() . "\<Right>"
"inoremap <expr><Up> neocomplete#close_popup() . "\<Up>"
"inoremap <expr><Down> neocomplete#close_popup() . "\<Down>"
" Or set this.
"let g:neocomplete#enable_cursor_hold_i = 1
" Or set this.
"let g:neocomplete#enable_insert_char_pre = 1
" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1
" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplete#enable_auto_select = 1
"let g:neocomplete#disable_auto_complete = 1
"inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
" 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
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
"let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
"let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
"let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
"end for neocomplete
"}}}
" Unite: {{{
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
call unite#custom#profile('default', 'context', {'no_split':1, 'resize':0})
"" ------------ define custom action -------------------------------------------
"" file_association
"let s:file_association = {
"\ 'description' : 'open withd file associetion'
"\ , 'is_selectable' : 1
"\ }
"function! s:file_association.func(candidates)
"for l:candidate in a:candidates
"" .vimrcに関数の定義有り
"call OpenFileAssociation(l:candidate.action__path)
"endfor
"endfunction
"call unite#custom_action('openable', 'file_association', s:file_association)
"unlet s:file_association
"call unite#custom#source('file_rec/async','sorters','sorter_rank', )
" replacing unite with ctrl-p
"let g:unite_enable_split_vertically = 1
let g:unite_source_file_mru_time_format = "%m/%d %T "
let g:unite_source_directory_mru_limit = 80
let g:unite_source_directory_mru_time_format = "%m/%d %T "
let g:unite_source_file_rec_max_depth = 6
let g:unite_enable_ignore_case = 1
let g:unite_enable_smart_case = 1
let g:unite_data_directory='~/.cache/unite'
let g:unite_enable_start_insert=1
let g:unite_source_history_yank_enable=1
let g:unite_prompt='>> '
let g:unite_split_rule = 'botright'
let g:unite_winheight=25
let g:unite_source_grep_default_opts = "-iRHn"
\ . " --exclude='tags'"
\ . " --exclude='cscope*'"
\ . " --exclude='*.svn*'"
\ . " --exclude='*.log*'"
\ . " --exclude='*tmp*'"
\ . " --exclude-dir='**/tmp'"
\ . " --exclude-dir='CVS'"
\ . " --exclude-dir='.svn'"
\ . " --exclude-dir='.git'"
\ . " --exclude-dir='node_modules'"