后面转入linux开发环境后一直也是用si(通过wine安装)但是很不稳定,经常会出各种问题死掉。所以决定切换用vim来代替si,vim号称程序员最好用的代码编辑器,再说了,作为一个混迹多年江湖的程序猿,不去好好感受下这么优秀工具,岂不是暴殄天物?
网上找了很多资料,终于搭建了自己的 vim “IDE”,用了一段时间了,感觉还不错 ~
整合的主要功能有:
1、各自目录树、符号列表、搜索窗口切换定义;
2、ctags + cscope支持,而且 各个打开的vim工程独立不干扰,存放到~/.ctags/ 目录下;
3、保存当前vim配置,下次打开vim还是原来的配置,方便使用,而且最关键的是各个vim工程独立,同样保存在~/.ctags/目录下;
5、各种常用必备插件已配置;
6、其它详细部分见vimrc配置吧;
下面贴出来分享下。
整合好的地址:
git clone https://github.com/guomingyi/vim-warper.git
相关快捷键配置:
- # Install
- ########################################
- cp -a .vim ~/.vim
- cp -a .vimrc ~/.vimrc
- # Ctags:
- cd ~/.vim/depends/
- unzip ctags-5.8.zip
- cd ctags-5.8
- ./configure
- make
- sudo make install
- # Cscope:
- 参考Ctags步骤.
- ##################[快捷键定义]#################
- # 窗口类:
- f2 鼠标使能切换
- \f2 行号显示切换
- f3 tagbarlist
- \f3 NERDTree
- f4 Ctrlp,文件模糊搜索,也可按ctrl+p打开,按esc退出
- \f4 MRU,文件打开历史记录,可保存
- f5 make tags,用于查看代码进入函数跳转,支持多目录加载
- \f5 make cscope,ctags的升级,功能更强大,暂不支持多目录加载
- f6 Buf exploler,当前文件打开记录缓存
- \f6 miniBufExploler,跟上一个类同
- \f7 themes switch
- # 文件跳转:
- 1 跳转到上一个文件
- 2 跳转到下一个文件
- \1 关闭当前文件
- 3 quickfix列表搜索文件条状到下一个
- 4 quickfix跳转到上一个
- # 更新插件:
- \3 更新插件
- # 退出:
- \q 退出当前窗口
- \qa 不保存seesion.vim退出全部
- \qs 保存session.vim退出全部
- F2 同\qs
- \w :w
- # ACK搜索相关:
- \s Ack 搜索,先按下\s,再输入需要搜索的字符,回车
- \f AckFile搜索,同上
- # ag 搜索
- sudo apt-get install silversearcher-ag
- # Cscope相关:
- cc 搜索该函数调用的函数
- cd 搜索调用该函数的函数
- cs 搜索函数
- cf 搜索文件
- ct 搜索字符串
- # 特殊命令:
- # 有时候vim的历史记录会有混乱,这个时候有两种方式还原:
- 1> rm -rf ~./ctags/
- 2> vim clean
打开后默认界面:
按 F3 切换显示tagbar ,\F3 切换显示nerdtree, F4 弹出ctrlp模糊搜索
按\F4 切换ctrlp-funky,模糊搜索当前文件函数,ctrlp搜索使用外部ag搜索引擎
buffer 浏览器,按F6切换
F5 执行make tags,tags的目录做了重定向,每个新打开的vim工程互不干扰。
make cscope,和ctags类同
ag搜索符号
vimrc 全配置:
- 1
- 2 "##################################################################[Plugin manager]
- 3 " http://www.cnblogs.com/songfy/p/5635757.html
- 4 set rtp+=~/.vim/bundle/Vundle.vim
- 5
- 6 call vundle#begin()
- 7
- 8 Plugin 'VundleVim/Vundle.vim'
- 9 Plugin 'tpope/vim-fugitive'
- 10 Plugin 'vim-scripts/winmanager'
- 11 Plugin 'rstacruz/sparkup',{'rtp': 'vim/'}
- 12 Plugin 'kien/ctrlp.vim'
- 13 Plugin 'wincent/command-t'
- 14 Plugin 'scrooloose/nerdtree'
- 15 Plugin 'majutsushi/tagbar'
- 16 Plugin 'jiangmiao/auto-pairs'
- 17 Plugin 'minibufexpl.vim'
- 18 Plugin 'jlanzarotta/bufexplorer'
- 19 Plugin 'taglist.vim'
- 20 Plugin 'scrooloose/nerdcommenter'
- 21 Plugin 'godlygeek/tabular'
- 22 Plugin 'plasticboy/vim-markdown'
- 23 Plugin 'portante/cscope'
- 24 Plugin 'tomasr/molokai'
- 25 Plugin 'yegappan/mru'
- 26 Plugin 'rking/ag.vim'
- 27 Plugin 'altercation/vim-colors-solarized'
- 28 Plugin 'tacahiroy/ctrlp-funky'
- 29 Plugin 'Lokaltog/vim-distinguished'
- 30
- 31 "Plugin 'Valloric/YouCompleteMe' "NEED VIM8.0+ & PYTHON3.5+ support.
- 32 "Plugin 'vim/vim' "vim8.0+
- 33
- 34 call vundle#end()
- 35
- 36 filetype plugin indent on
- 37 "##################################################################[default value set]
- 38 modelines=0
- 39 backspace=2 "设置更好的删除
- 40 Syntax on "语法高亮
- 41 "set noswapfile
- 42 "autocmd InsertLeave * se nocul "用浅色高亮当前行
- 43 "autocmd InsertEnter * se cul
- 44 cul
- 45 paste
- 46 smartindent "智能对齐
- 47 autoindent "自动对齐
- 48 confirm "在处理未保存或只读文件的时候,弹出确认框
- 49 tabstop=4 "tab键的宽度
- 50 softtabstop=4
- 51 shiftwidth=4 "统一缩进为4
- 52 expandtab "不要用空格替代制表符
- 53
- 54 history=50 "历史纪录数
- 55 "set nohlsearch
- 56 hlsearch
- 57 incsearch "搜素高亮,搜索逐渐高亮
- 58
- 59 gdefault "行内替换
- 60 encoding=utf-8
- 61 fileencodings=utf-8,ucs-bom"编码设置
- 62
- 63 guifont=Menlo:h16:cANSI "设置字体
- 64 langmenu=zn_CN.UTF-8
- 65 helplang=cn "语言设置
- 66
- 67 ruler "在编辑过程中,在右下角显示光标位置的状态行
- 68 laststatus=1 "总是显示状态行
- 69 showcmd "在状态行显示目前所执行的命令,未完成的指令片段也会显示出来
- 70 scrolloff=3 "光标移动到buffer的顶部和底部时保持3行的距离
- 71 "set showmatch "高亮显示对应的括号
- 72 matchtime=5 "对应括号高亮时间(单位是十分之一秒)
- 73 autowrite "在切换buffer时自动保存当前文件
- 74 wildmenu "增强模式中的命令行自动完成操作
- 75 linespace=2 "字符间插入的像素行数目
- 76 whichwrap=b<,98)">>"开启normal 或visual模式下的backspace键空格键,
- 77 "左右方向键,insert或replace模式下的左方向键,右方向键的跳行功能
- 78
- 79 "分为三部分命令:file on,file plugin on,file indent on
- 80 "分别是自动识别文件类型,用用文件类型脚本,使用缩进定义文件
- 81
- 82 foldenable "允许折叠
- 83 cursorline "突出显示当前行
- 84 magic "设置魔术?神马东东
- 85 ignorecase "搜索忽略大小写
- 86 "filetype on "打开文件类型检测功能
- 87
- 88 foldmethod=Syntax "使用语法高亮定义代码折叠: zc 折叠,zo 展开
- 89 foldlevelstart=99 "打开文件是默认不折叠代码
- 90
- 91 "set mouse= "鼠标默认值
- 92 "set number "显示行号
- 93
- 94 " 自动切换vim工作目录
- 95 " set autochdir
- 96 " :cd 改变vim的当前工作路径
- 97 " :lcd 改变当前窗口的工作路径
- 98 " :pwd 查看当前的工作路径
- 99
- 100 behave mswin
- 101
- 102 if has("autocmd")
- 103 au BufReadPost * line"'\"") > 1 && <= "$") | exe "normal! g'\"" | endif
- 104 InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
- 105 InsertLeave * "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
- 106 VimLeave * "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
- 107 endif
- 108 "##################################################################[auto exec cmds]
- 109 "autocmd VimEnter * TagbarToggle "auto start cmd
- 110 "autocmd VimEnter * WMToggle "auto start cmd
- 111 "autocmd VimEnter * NERDTree "auto start cmd
- 112
- 113 "default themes
- 114 autocmd VimEnter * call UserFunctionSwitch(6)
- 115
- 116 " default show line number
- 117 0)
- 118
- 119 " default enable mouse
- 120 1)
- 121
- 122 "Open Nerdtree when start vim with no argument
- 123 argc() == 0 && !exists"s:std_in")
- 124 " autocmd VimEnter * WMToggle
- 125 endif
- 126
- 127
- 128 BufNewFile * 52)
- 129
- 130 "##################################################################[ctags]
- 131 " Press F5 to update make ctags.
- 132 " cd ~/.ctags
- 133 " ctags -R ${source_path}
- 134 "silent !~/.vim/shell/make-ctags.sh
- 135 let g:pwd = getcwd()
- 136 g:Newpwd ()
- 137 "let g:Newpwd = substitute(g:pwd,$HOME,"",128)">)
- 138 = "~/.ctags/" . substitute(g:Newpwd,"/",135)">"_",135)">"g")
- 139
- 140 settag "set tags=" . . "/tags"
- 141 "echo settag
- 142 exec settag
- 143
- 144 g:argc ()
- 145 g:argv argv)
- 146 "echo "argv:" g:argv "argc:" g:argc
- 147
- 148 if (expand(g:argv== "clean"))
- 149 g:clean = 1
- 150 echo "clean all session.vim.."
- 151 silent :!~/.vim/shell/delsh
- 152 endif
- 153
- 154 "##################################################################[key map]
- 155 nmap 1 : bp cr>
- 156 nmap 2 : bn >
- 157 nmap Leader>1 : bd >
- 158 >3 : PluginInstall >
- 159
- 160 nmap 3 : cn >
- 161 nmap 4 : cp >
- 162
- 163 nmap 5 C-]>
- 164
- 165 nmap 6 C-o>
- 166
- 167 nmap 7 C-i>
- 168
- 169 "行号切换
- 170 map silent> F2> : call UserFunctionSwitch(0) CR>
- 171 "鼠标切换
- 172 >> : call UserFunctionSwitch(1) >
- 173
- 174 "neadtree
- 175 F3> : call UserFunctionSwitch(2) >
- 176 "tagbarlist
- 177 > : call UserFunctionSwitch(3) >
- 178
- 179 "mru,file open history record
- 180 " nmap <silent> <Leader><F4> : call UserFunctionSwitch(4) <CR>
- 181 "file search
- 182 F4> : exec "CtrlP ." >
- 183 > : exec "CtrlPFunky" >
- 184 nmap fu : execute 'CtrlPFunky ' . expand('')
- 185
- 186 "make source tags
- 187 F5> : call UserFunctionSwitch(5) >
- 188 > : call UserFunctionSwitch(51) >
- 189
- 190 "miniBuf
- 191 F6> : call UserFunctionSwitch(70) >
- 192 "buf exploler
- 193 > : call UserFunctionSwitch(7) >
- 194
- 195 "quickfix
- 196 F7> : call UserFunctionSwitch(8) >
- 197 "nmap <silent> 8 : call UserFunctionSwitch(80) <CR>
- 198 "nmap <silent> 9 : call UserFunctionSwitch(81) <CR>
- 199 "themes switch
- 200 > : call UserFunctionSwitch(6) >
- 201
- 202 F8> : call UserFunctionSwitch(50) >
- 203
- 204 "ack search file & symbols
- 205 >s : Ack Space>
- 206 >f : AckFile >
- 207 >q : q >
- 208 >qa : qall >
- 209 nmap :ag : Ag -i >
- 210 nmap :af : AgFile >
- 211
- 212 " quit all & save session.vim.
- 213 F12> : call UserFunctionSwitch(30) >
- 214 >qs : call UserFunctionSwitch(30) >
- 215 >wq : wq >
- 216 >w : w >
- 217 >rn : %s/\r//g > "替换^M
- 218 >rs : call LeaveHandler() >
- 219
- 220 " cscope
- 221 nmap cc : cscope find c >
- 222 nmap cd : cscope find d >
- 223 nmap cf : cscope find f >
- 224 nmap cg : cscope find g >
- 225 nmap cs : cscope find s >
- 226 nmap ct : cscope find t >
- 227 "##################################################################[function]
- 228 g:userFuncSwitch 1
- 229 g:line_number_show 0
- 230 g:mouse_enable 0
- 231 g:window_flag 1
- 232 g:MRU_flag 0
- 233 g:themes_flag 1
- 234 g:ctags ""
- 235
- 236 g:quickfix 0
- 237
- 238 function! UserFunctionSwitch(cmd)
- 239 = a:cmd
- 240 exec ":Syntax on"
- 241
- 242 if a:cmd 0
- 243 0
- 244 'set nu'
- 245 1
- 246 'Show line number!'
- 247 else
- 248 'set nonu'
- 249 0
- 250 endif
- 251 return
- 252 endif
- 253
- 254 1
- 255 0
- 256 1
- 257 'set mouse=n'
- 258 'enable mouse'
- 259 else
- 260 0
- 261 'set mouse='
- 262 'disable mouse'
- 263 endif
- 264 return
- 265 endif
- 266
- 267 2
- 268 'WMToggle'
- 269 return
- 270 endif
- 271
- 272 3
- 273 'TagbarToggle'
- 274 return
- 275 endif
- 276
- 277 4
- 278 0
- 279 1
- 280 'MRU'
- 281 else
- 282 0
- 283 'MRU'
- 284 'q'
- 285 endif
- 286 return
- 287 endif
- 288
- 289 5
- 290 "Start make tag.."
- 291 g:time1 localtime()
- 292 system"~/.vim/shell/make-ctags.sh " shellescape'%:h')))
- 293 g:ctag_execcmd "set tags+=" g:ctags
- 294 g:ctag_execcmd
- 295 g:time2 ()
- 296 echo g:ctag_execcmd "escape time:" (g:time2 - g:time1)"s"
- 297 return
- 298 endif
- 299
- 300 " 一键更新ctags & cscope..
- 301 50
- 302 " exec g:ctag_execcmd
- 303 " cs kill -1
- 304 " exec g:cscope_cmd
- 305 return
- 306 endif
- 307
- 308 51
- 309 "Start make cscope.."
- 310 t1 ()
- 311 db "~/.vim/shell/cscope.sh " '%:p')))
- 312 path strpart(db,0,match"cscope.out")) " 必须这样截取,否则多余的结束符^@会导致cs add 异常.
- 313 g:cscope_cmd "cs add " . path "cscope.out"
- 314 g:cscope_cmd
- 315 cs kill -1
- 316 g:cscope_cmd
- 317 t2 ()
- 318 t2 - t1)"s"
- 319 return
- 320 endif
- 321
- 322 " 监听执行命令
- 323 52
- 324 " let cwd = getcwd()
- 325 " echo "cwd:" cwd
- 326 return
- 327 endif
- 328
- 329
- 330 6
- 331
- 332 0
- 333 1
- 334 "colorscheme solarized"
- 335 g:molokai_original 0
- 336 g:rehash256 0
- 337 "set background=dark"
- 338 "set t_Co=32"
- 339 return
- 340 endif
- 341 1
- 342 2
- 343 "colorscheme molokai"
- 344 1
- 345 1
- 346 "set background=dark"
- 347 "set t_Co=256"
- 348 return
- 349 endif
- 350
- 351 2
- 352 3
- 353 0
- 354 0
- 355 "colorscheme default"
- 356 "set background=light"
- 357 "set t_Co=128"
- 358 return
- 359 endif
- 360
- 361 3
- 362 1
- 363
- 364 "set background=dark"
- 365 "set t_Co=256"
- 366 return
- 367 endif
- 368 return
- 369 endif
- 370
- 371
- 372 70
- 373 'TMiniBufExplorer'
- 374 return
- 375 endi
- 376
- 377 7
- 378 'ToggleBufExplorer'
- 379 return
- 380 endif
- 381
- 382 8
- 383 0
- 384 1
- 385 "cclose"
- 386 else
- 387 0
- 388 "copen"
- 389 endif
- 390 return
- 391 endif
- 392
- 393 80
- 394 1
- 395 "bn"
- 396 else
- 397 "cn"
- 398 endif
- 399 return
- 400 endif
- 401
- 402 81
- 403 1
- 404 "bp"
- 405 else
- 406 "cp"
- 407 endif
- 408 return
- 409 endif
- 410
- 411 20
- 412 "call MyTabLine()
- 413 "echo 'tab:' tab
- 414 return
- 415 endif
- 416
- 417 30
- 418 g:quit_save 1
- 419 "qall"
- 420 return
- 421 endif
- 422
- 423 endfunction
- 424
- 425 "##################################################################[TlistToggle,NERDTree]
- 426 NERDTreeQuitOnOpen=1 "打开文件时关闭树
- 427 NERDTreeShowBookmarks"显示书签
- 428 Tlist_Show_One_File " 不同时显示多个文件的 tag ,只显示当前文件的
- 429 Tlist_Exit_OnlyWindow " 如果 taglist 窗口是最后一个窗口,则退出 vim
- 430 Tlist_Use_Right_Window 1
- 431 Tlist_Auto_Open 0
- 432 "###################################################################[cscope]
- 433 " http://www.jb51.cc/article/p-hjohkcxr-bb.html
- 434
- 435 " 安装:
- 436 " sudo apt-get install cscope
- 437
- 438 " 创建索引:
- 439 " cscope -Rbq
- 440 " 把需要创建索引的文件类型输入到这个文件
- 441 " find . -type f > cscope.files
- 442
- 443 " 添加到vim:
- 444 " :cs add ./cscope.out
- 445
- 446 " 查找函数func:
- 447 " :cs find s func
- 448
- 449 " vim支持8种cscope的查询功能,如下:
- 450 " s: 查找C语言符号,即查找函数名、宏、枚举值等出现的地方(包括头文件)
- 451 " g: 查找函数、宏、枚举等定义的位置,类似ctags所提供的功能(比如有可能只在头文件处)
- 452 " d: 查找本函数调用的函数
- 453 " c: 查找调用本函数的函数
- 454 " t: 查找指定的字符串
- 455 " e: 查找egrep模式,相当于egrep功能,但查找速度快多了
- 456 " f: 查找并打开文件,类似vim的find功能
- 457 " i: 查找包含本文件的文件
- 458 " 其他功能可输入:help cscope查看
- 459
- 460 "cscope")
- 461 " set csprg=/usr/bin/cscope
- 462 csprg=cscope
- 463 csto=1
- 464 cst
- 465 nocsverb
- 466 " add any database in current directory
- 467 " if filereadable("cscope.out")
- 468 " cs add cscope.out
- 469 " else add database pointed to by environment
- 470 " elseif $CSCOPE_DB != ""
- 471 " cs add $CSCOPE_DB
- 472 " endif
- 473 csverb
- 474 endif
- 475
- 476 "##################################################################[Ctrlp]
- 477 rtp+=~/.vim/bundle/ctrlp.vim
- @H_439_2404@478 :helptags ~/vim/bundle/ctrlpvim/doc
- 479 g:ctrlp_map '<c-p>'
- 480 g:ctrlp_cmd 'CtrlP'
- 481 g:ctrlp_working_path_mode 'cra'
- 482
- 483 g:ctrlp_custom_ignore = {
- 484 \ 'dir': '\v[\/]\.(git|hg|svn|rvm|out|gen)$',485 'file': '\v\.(exe|so|dll|zip|tar|tar.gz|pyc|a|img|apk|bak|ko|deb|~|swp|tmp|html|jpg|png|bmp|ogg|log|jar|o)$',486 \ }
- 487
- 488 wildignore+=*/tmp/*489
- 490 g:ctrlp_regexp 1
- 491
- 492 g:ctrlp_cache_dir '~/.cache/ctrlp'
- 493 g:ctrlp_show_hidden 0
- 494
- 495 " sudo apt-get install silversearcher-ag
- 496 " when use ag,add custom ignore to : ~/.agignore
- 497 executable'ag')
- 498 g:ctrlp_use_caching 1
- 499 grepprg=ag\ --nogroup\ --nocolor
- 500 g:ctrlp_user_command 'ag %s -l --nocolor --hidden -g ""'
- 501 else
- 502 1
- 503 = ['.git',135)">'cd %s && git ls-files . -co --exclude-standard',135)">'find %s -type f']
- 504 g:ctrlp_prompt_mappings {
- 505 'AcceptSelection("e")': ['<space>',135)">'<cr>',135)">'<2-LeftMouse>'],506 }
- 507 endif
- 508
- 509 " echo "g:ctrlp_user_command :" g:ctrlp_user_command
- 510
- 511 g:ctrlp_clear_cache_on_exit 0
- 512 g:ctrlp_max_depth 100
- 513 g:ctrlp_max_files 5000000
- 514
- 515 " ctrlp-funky
- 516 g:ctrlp_funky_Syntax_highlight 1
- 517 "##################################################################[winManager]
- 518 g:NERDTree_title="[NERDTree]"
- 519 g:winManagerWindowLayout'NERDTree'
- 520
- 521 function! NERDTree_Start()
- 522 'NERDTree'
- 523 endfunction
- 524
- 525 function! NERDTree_IsValid()
- 526 return 1
- 527 endfunction
- 528
- 529 " NOTIC!!! modefiy WinManager.vim to fixed open empty file bug:
- 530 "function! <SID>ToggleWindowsManager()
- 531 " if IsWinManagerVisible()
- 532 " call s:CloseWindowsManager()
- 533 " else
- 534 " call s:StartWindowsManager()
- 535 " exe 'q' " ADD THIS LINE!
- 536 " end
- 537 "endfunction
- 538
- 539 "##################################################################[MiniBufExplorer]
- 540 g:default_open_minibufexplorer 0
- 541 g:miniBufExplMapWindowNavVim 1
- 542 g:miniBufExplMapWindowNavArrows 1
- 543 g:miniBufExplMapCTabSwitchBufs 1
- 544 g:miniBufExplModSelTarget 1
- 545 g:miniBufExplMoreThanOne0
- 546
- 547 "BufExplorer
- 548 rtp+=~/.vim/bundle/bufexplorer
- 549
- 550 g:bufExplorerShowRelativePath0 " Show absolute paths.
- 551 g:bufExplorerSortBy'extension'
- 552 'fullpath'
- 553 'mru'
- 554 'name'
- 555 'number'
- 556
- 557 "nmap <silent> <s-F7> :BufExplorer<CR>
- 558 "nmap <silent> <m-F7> :BufExplorerHorizontalSplit<CR>
- 559 "nmap <silent> <c-F7> :BufExplorerVerticalSplit<CR>
- 560 "##################################################################[SuperTab]
- 561 g:SuperTabDefaultCompletionType"context"
- 562
- 563 "##################################################################[TagbarToggle]
- 564 g:tagbar_ctags_bin 'ctags'
- 565 g:tagbar_width 30
- 566
- 567 "##################################################################[mru]
- 568 rtp+=~/.vim/bundle/mru
- 569 g:MRU_Max_Entries 1000
- 570 g:MRU_Exclude_Files '^/tmp/.*\|^/var/tmp/.*' " For Unix
- 571 g:MRU_Include_Files '\.c$\|\.h$'
- 572 g:MRU_Window_Height 8
- 573 "let g:MRU_Use_Current_Window = 1
- 574 g:MRU_Auto_Close 0
- 575 g:MRU_Max_Menu_Entries 20
- 576
- 577 "##################################################################[auto-pairs]
- 578 runtimepath^=~/.vim/bundle/auto-pairs
- 579 g:AutoPairsFlyMode 1
- 580 g:AutoPaiRSShortcutBackInsert '<M-b>'
- 581 laststatus=2
- 582 "##################################################################[nerdcommenter] "\cc 注释当前行和选中行
- 583 "\cu 取消注释
- 584 rtp+=~/.vim/bundle/nerdcommenter
- 585 g:NERDSpaceDelims 1
- 586 g:NERDAltDelims_java 1
- 587 g:NERDCustomDelimiters { 'c': 'left': '/**',135)">'right': '*/' } }
- 588 g:NERDCommentEmptyLines 1
- 589 g:NERDTrimTrailingWhitespace 1
- 590 g:NERDCompactSexyComs 1
- 591
- 592 "##################################################################[ack]
- 593 rtp+=~/.vim/bundle/ack.vim
- 594 g:ackprg '~/.vim/shell/xgrep' "find symbols and files.
- 595 g:ack_autoclose 1
- 596 g:ackpreview 1
- 597 g:ackhighlight 1
- 598 g:ack_autofold_results 0
- @H_932_3012@599 g:ack_lhandler "botright lopen 8"
- @H_941_3018@600 g:ack_qhandler "botright copen 8"
- 601
- 602 "##################################################################[resume history]
- 603 g:AutoSessionFile "/session.vim"
- 604 if(g:AutoSessionFilefindfile)))
- 605 copysh
- 606 source ~/.ctags/sessionvim
- 607 endif
- 608
- 609 g:AutoCscopeFile "/cscope.out"
- 610 (g:AutoCscopeFile)))
- 611 " 必须这样截取,否则多余的结束符^@会导致cs add 异常.
- 612 (g:AutoCscopeFile,98)">))
- 613 cmd "cscope.out"
- 614 "path:" path
- 615 "cmd:" cmd
- 616 silent: cmd
- 617 endif
- 618
- 619 call LeaveHandler()
- 620 function! LeaveHandler()
- 621 (g:quit_save )
- 622 g:path "~/.vim/shell/get_path.sh " )))
- 623 execcmd "mks! "g:path
- 624 execcmd
- 625 execcmd
- 626 else
- 627 "exit but no save session.vim"
- 628 endif
- 629 endfunction
- 630
- 631
现在,基本可以使用vim代替si了 !