倾情奉献新研究出来的几个键绑定,把它们加入到$HOME/.vimrc就可以啦,enjoy:)
绑定的键及功能如下:
打开一个文件浏览器窗口(再按不能关闭该窗口:( )
打开一个函数,宏,全局变量等符号浏览窗口(需
taglist vim插件支持)
打开错误修正窗口(需要会在vim中用make,grep)
Alt+; 根据文件类型在行尾智能添加注释,C风格为/* */,C++ Java风格为//,shell风格为在一行#
Alt+' 根据文件类型智能注释当前行,C风格为/* */,C++ Java风格为//,shell风格为在一行#
Ctrl+x+l 列出当前编译错误
Ctrl+x+n 跳到下一个错误
Ctrl+x+p 跳回上一个错误
Ctrl+x+c 跳到第n个错误
if has("cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable(" cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
" Open a file managers with
" map <F7> <ESC>:vsplit<ENTER>:edit `pwd`<ENTER>i
set browsedir=buffer
map <F7> <ESC>:browse 25vsplit .<CR><C-w>ri
" Open Tlist with
map :Tlist
" Close Tlist with resize
let Tlist_Inc_Winwidth=0
" Open quickfix window
map :call QuickFixWin()
let s:bQuick=0
function! QuickFixWin()
if s:bQuick==0
let s:bQuick=1
copen
elseif s:bQuick==1
let s:bQuick=0
cclose
endif
endfunction
imap s :wa
map s :w
" use Alt+; add comment,like emacs
autocmd filetype cpp,java map <Esc>; $a<tab><tab>//
autocmd filetype cpp,java imap <Esc>; <End><tab><tab>//
autocmd filetype c map <Esc>; $a<tab><tab>/* */<Esc>2hi
autocmd filetype c imap <Esc>; <End><tab><tab>/* */<Left><Left><Left>
autocmd filetype sh map <Esc>; O#
" use Alt+' comment current line
autocmd filetype cpp,java map ' ^i//
autocmd filetype cpp,java imap ' ^//
autocmd filetype c map ' ^i/*$*/
autocmd filetype c imap ' ^/*$*/
autocmd filetype sh map ' ^i#
autocmd filetype sh imap ' ^#
" use Ctrl+x+[l|n|p|cc] to list|next|previous|jump to count the result
map <C-x>l <ESC>:cl<ENTER>
map <C-x>n <ESC>:cn<ENTER>
map <C-x>p <ESC>:cp<ENTER>
map <C-x>c <ESC>:cc
|
|
文件: | vimrc.tar.bz2 |
大小: | 1KB |
下载: | 下载 |
|
阅读(1905) | 评论(0) | 转发(0) |