-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
157 lines (112 loc) · 3.16 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
"common setting
"set line number
set nu
"set tabs property
"expand tab into space
set expandtab
"tab takes up the number of space
set tabstop=4
"tab format take up the number of space
set shiftwidth=4
"constinuous space look into the tab
set softtabstop=4
"set encoding format
set encoding=utf-8
"define shortcut key's prefix key
let mapleader = ";"
"define shortcut key into line start
nmap LB b
"define shortcut key into line end
nmap LE e
"copy data into system's clipboard
"vnoremap <Leader>y "+y
"paste data of system's clipboard into vim
"nmap <Leader>p "+p
"save current window's data
nmap <Leader>w :w<CR>
"don't save modified data quit
nmap <Leader>q :q!<CR>
"open grammar highlight function
syntax enable
syntax on
" 跳转至左方的窗口
nnoremap <Leader>hw <C-W>h
"operation:打开或关闭当前折叠<Leader>zM,关闭所有折叠<Leader>zR
"grammar-based fold
set foldmethod=syntax
"crimple-based fold
"set foldmethod=indent
"when start vim,close the fold code
set nofoldenable
set backspace=indent,eol,start
"-------------------------------------------------
"------------------Vundle setting-----------------
"-------------------------------------------------
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"let Vundle manage Vundle
Bundle 'gmarik/vundle'
"-----------------
"my Bundle here:
"-----------------
" original repos on github
"Bundle 'kien/ctrlp.vim'
Bundle 'altercation/vim-colors-solarized'
Bundle 'octol/vim-cpp-enhanced-highlight'
Bundle 'majutsushi/tagbar'
Bundle 'Valloric/YouCompleteMe'
" vim-scripts repos
"Bundle 'YankRing.vim'
"non github repos
"Bundle 'git://git.wincent.com/command-t.git'
filetype plugin indent on
"------------------------------------------
"----------color scheme setting------------
"------------------------------------------
syntax enable
set background=light
"colorscheme solarized
" 设置 tagbar 子窗口的位置出现在主编辑区的左边
let tagbar_left=1
" 设置显示/隐藏标签列表子窗口的快捷键。速记:identifier list by tag
nnoremap <Leader>t :TagbarToggle<CR>
" 设置标签子窗口的宽度
let tagbar_width=32
" tagbar 子窗口中不显示冗余帮助信息
let g:tagbar_compact=1
" 设置 ctags 对哪些代码标识符生成标签
let g:tagbar_type_cpp = {
\ 'kinds' : [
\ 'c:classes:0:1',
\ 'd:macros:0:1',
\ 'e:enumerators:0:0',
\ 'f:functions:0:1',
\ 'g:enumeration:0:1',
\ 'l:local:0:1',
\ 'm:members:0:1',
\ 'n:namespaces:0:1',
\ 'p:functions_prototypes:0:1',
\ 's:structs:0:1',
\ 't:typedefs:0:1',
\ 'u:unions:0:1',
\ 'v:global:0:1',
\ 'x:external:0:1'
\ ],
\ 'sro' : '::',
\ 'kind2scope' : {
\ 'g' : 'enum',
\ 'n' : 'namespace',
\ 'c' : 'class',
\ 's' : 'struct',
\ 'u' : 'union'
\ },
\ 'scope2kind' : {
\ 'enum' : 'g',
\ 'namespace' : 'n',
\ 'class' : 'c',
\ 'struct' : 's',
\ 'union' : 'u'
\ }
\ }