“贡献出我的.vimrc,能copy的就copy去吧
“语言相关,编码设定
if has(“win32″)
set encoding=GBK
else
set encoding=utf-8
endif
set fileencoding=utf-8
set fileencodings=utf-8,GB2312,big5,GBK,gb18030,utf-16,
set ambiwidth=double
set fenc=
“F9一键编译
map :call Compile()
map :call Run()
map :call CompileRun()
“定义CompileRun函数,调用进行编译
func Compile()
exec “w”
“C程序
if &filetype == ‘c’
exec “!gcc % -Wall -O2 -s -o %
"C++程序
elseif &filetype == 'cpp'
exec "!g++ % -Wall -O2 -s -o %
endif
endfunc
"定义Run函数
func Run()
exec "!%
endfunc
"定义CompileRun函数
func CompileRun()
exec "w"
if &filetype == 'c'
exec "!gcc % -Wall -O2 -s -o %
exec "!%
elseif &filetype == 'cpp'
exec "!g++ % -Wall -O2 -s -o %
exec "!%4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1 shiftwidth=2 tabstop=4
“配色
colo darkblue
“语法高亮
syntax on
“默认无备份
set nobackup
“显示匹配括号
set showmatch
“允许退格键换行
set backspace=2
“去除VI一致性,解决方向键输出字母
set nocompatible
“解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim