-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyvimrc
209 lines (170 loc) · 5.01 KB
/
myvimrc
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
" =============================================================================
" FileName: myvimrc
" Desc: vim配置
" Author: tangfu
" Email: [email protected]
" HomePage: https://github.com/tangfu/myvim
" Version: 0.1.0
" LastChange: 2013-09-12 13:28:30
" =============================================================================
set nocompatible
source ~/.myvim/pathogen.vim
call pathogen#runtime_append_all_bundles()
call pathogen#infect('~/.myvim')
call pathogen#helptags()
set autoread
set nobomb
" 开启插件功能
filetype plugin indent on
set completeopt=longest,menu
syntax on
syntax enable
" set number
set mouse=
set noic
" 设置颜色模板
let g:molokai_original=1
set t_Co=256
set t_ut=
colorscheme molokai
" 设置backsapce
set backspace=indent,eol,start
" 开启代码折叠
set foldmethod=syntax
set foldlevel=100
" 设置tags
set tags=tags;
" set autochdir
" 开启显示换行
set wrap
" 高亮显示匹配的括号
set showmatch
" 高亮搜索词
set hlsearch
" 为C程序提供自动缩进
set cindent
set autoindent
set smartindent
"突出显示当前行
set cursorline
" 统一缩进为4
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" 在处理未保存或只读文件的时候,弹出确认
set confirm
" set paste
set pastetoggle=<F5>
" Tabular 设置对齐
map ta :Tabular /
" rst_table 设置表格
" 必须先写数据再执行命令
map ttc ,,c
map ttf ,,f
" txtbrowser
au BufEnter *.txt setlocal ft=txt
let TxtBrowser_Dict_Url = 'http://dict.cn/text'
let Txtbrowser_Search_Engine='http://www.baidu.com/s?wd=text&oq=text&f=3&rsp=2'
" 重新映射txtbrowser中的快捷键:ts - 搜索单词;tf - 查单词;tg - 打开链接
map ts <leader>s
map tf <leader>f
map tg <leader>g
" load_template
let g:template_path = '~/template/'
map lt :LoadTemplate<cr>
" neocomplete
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#auto_completion_start_length = 3
let g:neocomplete#max_list = 10
" indent_line
let g:indentLine_enabled = 0
map <Leader>l :IndentLinesToggle<CR>
" let g:indentLine_first_char = '¦'
let g:indentLine_char = '¦'
let g:indentLine_fileType = ['c', 'h', 'hpp', 'cpp', 'py', 'sh']
" easymotion
let g:EasyMotion_smartcase = 1
map ,h <Plug>(easymotion-linebackward)
map ,j <Plug>(easymotion-j)
map ,k <Plug>(easymotion-k)
map ,l <Plug>(easymotion-lineforward)
map ,f <Plug>(easymotion-f)
map ,F <Plug>(easymotion-F)
map ,/ <Plug>(easymotion-sn)
omap ,/ <Plug>(easymotion-tn)
" multi_edit
let g:multiedit_auto_reset = 1
let g:multiedit_auto_restore = 1
" 设置NERDTree插件
nmap <F7> :NERDTreeToggle<CR>
"设置NERDTree子窗口宽度
let NERDTreeWinSize=20
"设置NERDTree子窗口位置
let NERDTreeWinPos="right"
" bookmarking
map <silent> bt :ToggleBookmark<CR>
map <silent> bn :NextBookmark<CR>
map <silent> bp :PreviousBookmark<CR>
" 清除行尾空格
nmap bc :%s/ *$//g<cr>:nohl<cr>
" fencview
set encoding=utf-8
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
let g:fencview_autodetect=1
let g:fencview_auto_patterns='*'
"let g:fencview_checklines = 10
map <F3> :FencAutoDetect<cr>
" ZoomWin
map <F8> :ZoomWin<cr>
" doxygen setting
let g:DoxygenToolkit_authorName="tangfu - [email protected]"
let g:DoxygenToolkit_licenseTag="UESTC\<enter>"
let g:DoxygenToolkit_briefTag_funcName="yes"
let g:DoxygenToolkit_briefTag_pre="@brief\t"
let g:DoxygenToolkit_paramTag_pre="@param\t"
let g:DoxygenToolkit_returnTag="@return\t"
let g:DoxygenToolkit_maxFunctionProtoLines=30
let g:doxygen_enhanced_color=1
" authorinfo setting
let g:vimrc_author='tangfu'
let g:vimrc_email='[email protected]'
let g:vimrc_homepage="http://www.rainhome.org"
nmap <F6> :AuthorInfoDetect<cr>
" DoxAuthor Dox DoxBlock三个命令的快捷操作
map <F2>a : DoxAuthor<CR>
map <F2>f : Dox<CR>
map <F2>b : DoxBlock<CR>
map <F2>c O///
" Taglist插件
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
nmap wm :Tlist<cr>
" TagBar插件
let g:tagbar_sort = 0
let g:tagbar_left = 1
let g:tagbar_width = 25
let g:tagbar_compact = 1
let g:tagbar_foldlevel = 1
nmap wt :TagbarToggle<cr>
" tabbar 插件
let g:Tb_UseSingleClick = 1
map <F12> :bdelete<CR>
" a.vim
nnoremap <silent> <F4> :A<CR>
" plugin - NERD_commenter.vim 注释代码用的,
" " [count],cc 光标以下count行逐行添加注释(7,cc)
" " [count],cu 光标以下count行逐行取消注释(7,cu)
" " [count],cm 光标以下count行尝试添加块注释(7,cm)
" " ,cA 在行尾插入 /* */,并且进入插入模式。 这个命令方便写注释。
" " 注:count参数可选,无则默认为选中行或当前行
" "-----------------------------------------------------------------
let NERDSpaceDelims=1 " 让注释符与语句之间留一个空格
let NERDCompactSexyComs=1 " 多行注释时样子更好看
" F10创建和更新tags
map <F10> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q<CR><CR>