1
1
set nocompatible
2
2
3
- " bundle setting
4
- au GUIEnter * call libcallnr (" vimtweak.dll" , " SetAlpha" , 234 )
3
+ " sql style
4
+ " let g:sql_type_default = 'mysql'
5
+
6
+ set backspace = indent ,eol ,start
7
+ set tabstop = 4
8
+ set shiftwidth = 4
9
+ set expandtab
10
+ set cindent
11
+
12
+ " 代码折叠
13
+ set fdm = marker
14
+ " set fdm=syntax
15
+
16
+ " 在编辑过程中,在右下角显示光标位置的状态行
17
+ set ruler
5
18
19
+ set showcmd
20
+ set hlsearch
21
+ " 搜索到文件两端时不重新搜索
22
+ set nowrapscan
23
+ set incsearch
24
+ set cino = g0:0 " let class's public: don't indent
25
+
26
+ " none of these should be word dividers, so make them not be
27
+ set iskeyword += _,$ ,@ ,% ,#
28
+
29
+ " allow backspace and cursor keys to cross line boundaries
30
+ set whichwrap += <,> ,h ,l
31
+
32
+ " this makes the color after the textwidth column highlighted
33
+ set colorcolumn = + 1
34
+
35
+ " 关闭错误声音
36
+ set noerrorbells
37
+
38
+ " 显示行号
39
+ set nu
40
+ " set cursorline
41
+ " 语法高亮度显示
42
+ let python_highlight_all= 1
43
+ syntax on
44
+
45
+ " 显示括号配对情况
46
+ set showmatch
6
47
filetype off " required!
7
48
8
- " set completeopt=longest,menu
9
- " 去掉预览窗口的显示
10
- " set completeopt-=preview
49
+ set completeopt = longest,menu
11
50
51
+ " bundle setting
12
52
" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
13
53
" aptitude install vim-gui-common
14
54
set rtp += ~/.vim/bundle/vundle/
@@ -17,6 +57,9 @@ call vundle#begin()
17
57
" let Vundle manage Vundle
18
58
" required!
19
59
Bundle ' gmarik/vundle'
60
+ " 状态栏
61
+ Bundle ' vim-airline/vim-airline'
62
+ Bundle ' vim-airline/vim-airline-themes'
20
63
21
64
" My bundles here:
22
65
" original repos on GitHub
@@ -37,8 +80,6 @@ Bundle 'jiangmiao/auto-pairs'
37
80
38
81
" cpp 补全,see http://www.vim.org/scripts/script.php?script_id=1520
39
82
Bundle ' vim-scripts/OmniCppComplete'
40
- Bundle ' vim-scripts/echofunc.vim'
41
- let g: EchoFuncLangsUsed = [" cpp" ]
42
83
43
84
Bundle ' scrooloose/syntastic'
44
85
let g: ycm_show_diagnostics_ui = 0
@@ -50,12 +91,18 @@ let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
50
91
Bundle ' Valloric/YouCompleteMe'
51
92
" cd ~/.vim/bundle/YouCompleteMe && ./install.py --clang-completer
52
93
94
+ " 提示函数参数
95
+ " Bundle 'vim-scripts/echofunc.vim'
96
+ " let g:EchoFuncLangsUsed = ["cpp"]
97
+
53
98
" vim-scripts repos
54
- Bundle ' SQLComplete.vim'
99
+ " Bundle 'SQLComplete.vim'
55
100
Bundle ' L9'
56
101
Bundle ' FuzzyFinder'
57
102
Bundle ' STL-Syntax'
58
- Bundle ' a.vim'
103
+ " Bundle 'a.vim'
104
+ " Bundle 'derekwyatt/vim-fswitch'
105
+
59
106
" Bundle 'c.vim'
60
107
Bundle ' ctags.vim'
61
108
Bundle ' taglist.vim'
@@ -75,8 +122,17 @@ Bundle 'git://git.wincent.com/command-t.git'
75
122
" 命令:
76
123
" CommandTBuffer
77
124
" CommandT
125
+ "
126
+
127
+ " gen tags
128
+ " Bundle 'vim-scripts/DfrankUtil'
129
+ " Bundle 'vim-scripts/vimprj'
130
+ " Bundle 'vim-scripts/indexer.tar.gz'
131
+
78
132
call vundle#end ()
79
133
134
+ " leader映射为逗号“,”
135
+ let mapleader = " ,"
80
136
81
137
" *****************************************************
82
138
" taglist配置 *
@@ -103,27 +159,64 @@ let Tlist_Use_SingClick=1
103
159
" let Tlist_Auto_Open=1
104
160
" Tlist 打开关闭快捷键 fn + F9
105
161
nnoremap <silent> <F9> :TlistToggle<CR>
162
+ let g: tagbar_autopreview = 1
106
163
107
164
108
165
" *****************************************************
109
166
" YouCompleteMe配置 *
110
167
" *****************************************************
111
- " leader映射为逗号“,”
112
- let mapleader = " ,"
168
+ " YCM 补全菜单配色
169
+ " 菜单
170
+ highlight Pmenu ctermfg= 2 ctermbg= 3 guifg= #005 f87 guibg= #EEE8D5
171
+
172
+ " 选中项
173
+ highlight PmenuSel ctermfg= 2 ctermbg= 3 guifg= #AFD700 guibg= #106900
174
+ " 补全功能在注释中同样有效
175
+ let g: ycm_complete_in_comments= 1
176
+
177
+ " 开启 YCM 标签补全引擎
178
+ let g: ycm_collect_identifiers_from_tags_files= 1
179
+
180
+ " 补全内容不以分割子窗口形式出现,只显示补全列表
181
+ set completeopt -= preview
182
+
183
+ " 从第一个键入字符就开始罗列匹配项
184
+ let g: ycm_min_num_of_chars_for_completion= 1
185
+ " 禁止缓存匹配项,每次都重新生成匹配项
186
+ let g: ycm_cache_omnifunc= 0
187
+ " 语法关键字补全
188
+ let g: ycm_seed_identifiers_with_syntax= 1
189
+
113
190
" 默认的ycm_extra_conf.py
114
191
let g: ycm_global_ycm_extra_conf = ' ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
115
192
" 打开vim时不再询问是否加载ycm_extra_conf.py配置
116
193
let g: ycm_confirm_extra_conf= 0
194
+ let g: ycm_semantic_triggers = {' c' : [' ->' , ' .' ], ' objc' : [' ->' , ' .' ], ' ocaml' : [' .' , ' #' ], ' cpp,objcpp' : [' ->' , ' .' , ' ::' ], ' php' : [' ->' , ' ::' ], ' cs,java,javascript,vim,coffee,python,scala,go' : [' .' ], ' ruby' : [' .' , ' ::' ]}
195
+
117
196
118
197
" Look for tag def in a "tags" file in the dir of the current file, then for
119
198
" that same file in every folder above the folder of the current file, until the
120
199
" root.
121
- " set tags=./tags;/
200
+ set tags = ./tags;/
122
201
" gen systags:
123
202
" ctags -R --fields=+aiKlSz --extra=+q --c++-kinds=+px .
124
- set notagbsearch
125
- " 使用ctags生成的tags文件
126
- let g: ycm_collect_identifiers_from_tag_files = 1
203
+ " set notagbsearch
204
+
205
+
206
+ " easymotin
207
+ " let g:EasyMotion_leader_key = 'f'
208
+ " <Leader>f{char} to move to {char}
209
+ map <leader> f <Plug> (easymotion-bd-f)
210
+ nmap <leader> f <Plug> (easymotion-overwin-f)
211
+ " m{char}{char} to move to {char}{char}
212
+ nmap <leader> m <Plug> (easymotion-overwin-f2)
213
+ " Move to line
214
+ map <leader> l <Plug> (easymotion-bd-jk)
215
+ nmap <leader> l <Plug> (easymotion-overwin-line)
216
+ " Move to word
217
+ " map <leader>w <Plug>(easymotion-bd-w)
218
+ " nmap <leader>w <Plug>(easymotion-overwin-w)
219
+
127
220
128
221
" leader映射为逗号“,”
129
222
" nnoremap <leader>d:YcmCompleter GoToDeclaration<CR>
@@ -134,53 +227,10 @@ let g:ycm_collect_identifiers_from_tag_files = 1
134
227
" 键位映射 *
135
228
" *****************************************************
136
229
137
- " sql style
138
- let g: sql_type_default = ' mysql'
139
-
140
- set backspace = indent ,eol ,start
141
- set tabstop = 4
142
- set shiftwidth = 4
143
- set expandtab
144
- set cindent
145
-
146
- " 代码折叠
147
- set fdm = marker
148
- " set fdm=syntax
149
-
150
- " 在编辑过程中,在右下角显示光标位置的状态行
151
- set ruler
152
-
153
- set showcmd
154
- set hlsearch
155
- " 搜索到文件两端时不重新搜索
156
- set nowrapscan
157
- set incsearch
158
- set cino = g0:0 " let class's public: don't indent
159
-
160
- " none of these should be word dividers, so make them not be
161
- set iskeyword += _,$ ,@ ,% ,#
162
-
163
- " allow backspace and cursor keys to cross line boundaries
164
- set whichwrap += <,> ,h ,l
165
-
166
- " this makes the color after the textwidth column highlighted
167
- set colorcolumn = + 1
168
-
169
-
170
- " 关闭错误声音
171
- set noerrorbells
172
-
173
- " 显示括号配对情况
174
- set showmatch
175
-
176
-
177
230
" F12 run python
178
231
map <F12> :!/usr/bin/python %
179
232
map <F9> :!~/go/bin/go run %
180
233
181
- " 语法高亮度显示
182
- let python_highlight_all= 1
183
- syntax on
184
234
185
235
filetype plugin indent on
186
236
set viminfo = '20 ,\" 50
@@ -200,13 +250,10 @@ if has("autocmd")
200
250
endif
201
251
" set bg=dark
202
252
203
- " 显示行号
204
- set nu
205
-
206
253
filetype plugin on
207
254
208
255
" highlight setting
209
- let c_no_curly_error= 1
256
+ " let c_no_curly_error=1
210
257
let g: ophigh_color = 226
211
258
let g: ophigh_color_gui = " #F6FF00"
212
259
let g: cpp_member_variable_highlight = 1
@@ -240,25 +287,51 @@ set background=light
240
287
" colorscheme monokai
241
288
" colorscheme molokai
242
289
" 暗色调主题,适合夜间
243
- " colorscheme colorsbox-stnight
244
- " colorscheme colorsbox-faff
245
- " colorscheme colorsbox-greenish
290
+ colorscheme colorsbox- stnight
291
+ " colorscheme colorsbox-faff
292
+ " colorscheme colorsbox-greenish
246
293
" colorscheme colorsbox-material
247
- " colorscheme colorsbox-stblue
294
+ " colorscheme colorsbox-stblue
248
295
" colorscheme colorsbox-stbright
249
- colorscheme colorsbox- steighties
296
+ " colorscheme colorsbox-steighties
250
297
" colorscheme wombat256
251
298
299
+ " 显示状态栏
300
+ set laststatus = 2
301
+ " 设置状态栏主题风格
302
+ let g: Powerline_colorscheme= ' molokai256'
303
+ let g: airline_theme = ' badwolf'
304
+
252
305
" Fast saving
253
306
" 前面leader为逗号“,”
307
+ noremap <leader> w <esc> :w!<cr>
254
308
inoremap <leader> w <esc> :w!<cr>
255
- noremap <leader> q :q<cr>
309
+ noremap <leader> q :q! <cr>
256
310
noremap <leader> x :x<cr>
311
+ inoremap <leader> x <esc> :x<cr>
257
312
258
313
" 上、下方向键
259
314
nmap j gj
260
315
nmap k gk
261
316
317
+ " find file
318
+ noremap <leader> t :CommandT<cr>
319
+
320
+ " 分屏
321
+ noremap <leader> s :vs<cr>
322
+ noremap <leader> p :sp<cr>
323
+
324
+ " 分屏多窗口跳转
325
+ noremap zj <c-w> j
326
+ noremap zk <c-w> k
327
+ noremap zl <c-w> l
328
+ noremap zh <c-w> h
329
+
330
+
331
+
332
+ " Ctrl + ] 多选择跳转
333
+ " nmap <c-]> g<c-]>
334
+
262
335
inoremap jk <esc>
263
336
264
337
" insert模式下快捷键
@@ -278,5 +351,3 @@ imap ;; <esc>A;<esc>
278
351
" enhance '<' '>' , do not need to reselect the block after shift it.
279
352
vnoremap < <gv
280
353
vnoremap > >gv
281
-
282
- au GUIEnter * call libcallnr (" vimtweak.dll" , " SetAlpha" , 234 )
0 commit comments