forked from openproject/openvims
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.vimrc
140 lines (116 loc) · 3.24 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
if has("win32")
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
endif
call pathogen#infect()
syntax on
filetype plugin indent on
set nu
set tabstop=4
set hlsearch
set incsearch
set shiftwidth=4
set autoindent
set expandtab
set mouse=a
set writebackup
syntax enable
set nocp
set background=dark
colorscheme solarized
" tags settting
" set tags=tags;
" set autochdir
let NERDTreeChristmasTree=1
let NERDTreeMouseMode=2
let NERDTreeHighlightCursorline=0
let NERDCompactSexyComs=1
let NERDSpaceDelims=1
let NERDTreeShowBookmarks=1
"nmap <C-h> <C-w>h
"nmap <C-j> <C-w>j
"nmap <C-k> <C-w>k
"nmap <C-l> <C-w>l
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | end " Auto Exit
" NERDCommand
let mapleader=","
map <F2> :silent! NERDTreeToggle<CR>
" TagbarToggle
map <F3> :silent! TagbarToggle<CR>
" FulCoverageFile
map <F4> :silent! FufCoverageFile<CR>
" NerdTree Book Mark
map <F5> :Bookmark <CR>
let NERDTreeIgnore=['cscope\.*','\.svn','\.git','\.o']
" Cscope
map <F6> :!find . -name '*.php' -o -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.java' -o -name '*.phtml' -name '*.ini' >cscope.files && cscope -bq<CR>:cs reset<CR>:cs add cscope.out<CR>
" MiniBuffer
map <C-c> :MBEbd<CR>
map <C-n> :MBEbn<CR>
map <C-b> :MBEbp<CR>
"Gundo
map <leader>h :GundoToggle<CR>
" NERDCommand
let mapleader=","
" Powerline
set laststatus=2
let g:Powerline_symbols = 'unicode'
" Supertab
let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-O>"
set ofu=syntaxcomplete#Complete
set completeopt=menu,longest
" Cscope
set cscopequickfix=s-,c-,d-,i-,t-,e-
set cscopetag
set csto=1
if filereadable("cscope.out")
cs add cscope.out
endif
set cscopeverbose
map <C-g>s :cs find s <C-R>=expand("<cword>")<CR><CR>:copen<CR>
map <C-g>g :cs find g <C-R>=expand("<cword>")<CR><CR>:copen<CR>
map <C-g>c :cs find c <C-R>=expand("<cword>")<CR><CR>:copen<CR>
map <C-g>t :cs find t <C-R>=expand("<cword>")<CR><CR>:copen<CR>
map <C-g>e :cs find e <C-R>=expand("<cword>")<CR><CR>:copen<CR>
map <C-g>f :cs find f <C-R>=expand("<cfile>")<CR><CR>:copen<CR>
map <C-g>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>:copen<CR>
map <C-g>d :cs find d <C-R>=expand("<cword>")<CR><CR>:copen<CR>
" 相对行号
set relativenumber
au FocusLost * :set number
au FocusGained * :set relativenumber
" 插入模式下用绝对行号, 普通模式下用相对
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
function! NumberToggle()
if(&relativenumber == 1)
set number
else
set relativenumber
endif
endfunc
nnoremap <C-r> :call NumberToggle()<cr>
" 配色方案
if has("gui_running")
colo solarized
else
colo desert
endif
"--------------------------------------------------
" Name: solarized
" Git: https://github.com/altercation/vim-colors-solarized.git
"--------------------------------------------------
let g:solarized_termcolors=256
let g:solarized_termtrans=0
let g:solarized_contrast="normal"
let g:solarized_visibility="high"
let g:solarized_underline=1
let g:solarized_italic=0
let g:solarized_degrade=0
let g:solarized_bold=1
let g:solarized_diffmode="normal"
let g:solarized_hitrail=0
let g:solarized_menu=1