您的位置:首页 > 其它

vim配置文件

2009-08-11 09:35 316 查看
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '/<cmd'
let cmd = '""' . $VIMRUNTIME . '/diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '/diff"'
endif
else
let cmd = $VIMRUNTIME . '/diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
"********************************************
" _vimrc/_gvimrc for windows
" BY Douboer
"********************************************

"
" echo "loading _vimrc ... "
"

"
" 不同中文编码显示
" 同时支持GBK和UTF-8编码
"
"set fileencoding=gb18030
"set fileencodings=utf-8,gb18030,utf-16,big5
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8
set encoding=cp936 "set encoding=utf-8

"
" 设置字体
"
"set guifont=Lucida_Console:h9:cANSI

"
" 启动最大化, 设置颜色方案
"
" winsize 1024 768
au GUIEnter * simalt ~x
colorscheme desert

"
"自动缩进
"
set autoindent

"
" 设置tab制表符为4个空格
"
set ts=4
set expandtab
set shiftwidth=4
set cinoptions=>4,e0,n0,f0,{0,}0,^0,:s,=s,l0,gs,hs,ps,ts,+s,c3,C0,(2s,us,
/U0,w0,m0,j0,)20,*30
"
"set cindent
"

" 展开显示文件类型菜单

let do_syntax_sel_menu = 1 | runtime! synmenu.vim | aunmenu &Syntax.&Show/ filetypes/ in/ menu

"
" 设置语法
"
"if &filetype != 'javacc'
" setlocal filetype=javacc
"endif
"set syntax=javacc
"cal SetSyn("cpp")
"cal SetSyn("vb")
"cal SetSyn("perl")
"cal SetSyn("awk")

"
" 备份文件放在指定目录
"
set backupdir=C:/tmp

"
" 没有警告音和视觉警告
"
set vb t_vb=

"
" 禁用swf交换文件
"
setlocal noswapfile

"
" 显示行号
"
set number

"
" 隐藏工具条
"
" see :help 'guioptions'
"
set guioptions-=T
"set guioptions-=m

"
" 状态条,显示字节数,列数,行数,当前行等信息
"
set statusline=%F%m%r%h%w/ [FORMAT=%{&ff}]/ [TYPE=%Y]/ [ASCII=/%03.3b]/ [HEX=/%02.2B]/ [POS=%04l,%04v][%p%%]/ [LEN=%L]
set laststatus=2 " always show the status line

"
"auto-comments for // and /* */
"setlocal comments=sO:*/ -,mO:*/ / ,exO:*/,s1:/*,mb:*,ex:*/,://
"
"disable auto-comments for //
"setlocal comments=sO:*/ -,mO:*/ / ,exO:*/,s1:/*,mb:*,ex:*/,f://
"
"disable auto-comments for // and /* */
"
"setlocal comments=sO:*/ -,mO:*/ / ,exO:*/,s1:/*
setlocal comments=""
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Auto_Open=0
let Tlist_Auto_Update=1
let g:winManagerWindowLayout='TagList|BufExplorer'
let g:miniBufExplMapCTabSwitchBufs=1
filetype plugin indent on
set completeopt=longest,menu
set nocp
filetype plugin on
set tags+=tags
set tags+=../tags
""""""""""""""""""""""""""""""
" BufExplorer
""""""""""""""""""""""""""""""
let g:bufExplorerDefaultHelp=0 " Do not show default help.
let g:bufExplorerShowRelativePath=1 " Show relative paths.
let g:bufExplorerSortBy='mru' " Sort by most recently used.
let g:bufExplorerSplitRight=0 " Split left.
let g:bufExplorerSplitVertical=1 " Split vertically.
let g:bufExplorerSplitVertSize = 30 " Split width
let g:bufExplorerUseCurrentWindow=1 " Open in new window.
autocmd BufWinEnter /[Buf/ List/] setl nonumber
set cscopequickfix=s-,c-,d-,i-,t-,e-
nmap <F8> :Tlist<cr>
nmap <F6> :cn<cr>
nmap <F7> :cp<cr>
nmap <F9> :vi .<cr>
"set autowrite
" 光标移动到buffer的顶部和底部时保持3行距离
set scrolloff=5
" 为C程序提供自动缩进
set smartindent

" 使用C样式的缩进
set cindent

" 制表符为4
set tabstop=4

" 统一缩进为4
set softtabstop=4
set shiftwidth=4
set nocompatible
set nohlsearch
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: