set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
let g:snip_set_textmate_cp=1
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

set cursorline " 当前光标所在行会有阴影

"打开语法高亮
syntax on

"tab转空格的一坨设置
set shiftwidth=4
set sts=4
set tabstop=4
set expandtab

"自动缩进设置
set cindent
set smartindent
set incsearch
set autoindent

"显示行号
set nu

" 不要备份
set nobackup

"设置colormode
colorscheme desert

" Monaco字体
set guifont=Courier_New:h12


" 更新时间200毫秒,针对taglist插件
set ut=200

"Show matching bracets
set showmatch

"Get out of VI's compatible mode
set nocompatible

"Set to auto read when a file is changed from the outside
set autoread

"Enable filetype plugin
filetype on
filetype plugin on
filetype indent on

"设置搜索结果高亮显示
set hlsearch

"设置记录的历史操作列表
set history=50

"设置折叠
set foldcolumn=2
set foldmethod=indent
set foldlevel=3


"Set mapleader
let mapleader = '\' " leader用反斜杠\
map <leader><leader> \be " 双反斜杠\\即可打开bufexplorer
map C-Enter C-Tab " Ctrl+Enter也可以切换buffer

"Taglist插件的一坨设置
let g:Tlist_Use_Right_Window=1
"let g:Tlist_Auto_Open=1
let g:Tlist_Show_One_File=1
let g:Tlist_Compact_Format=1
let g:Tlist_Enable_Fold_Column=0
let Tlist_Ctags_Cmd="'d:\Program Files\vim\vim71\plugin\ctags\ctags.exe'"
nnoremap <F12> :TlistToggle<CR>

"Calendar map
nnoremap <F11> :Calendar<CR>

"load project plugin
nnoremap <F10> :Project<CR>

"gvim打开以后最大化
au GUIEnter * simalt ~x

set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
"解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
language messages zh_CN.utf-8

posted on 2013-11-19 23:23  梦中彩虹  阅读(552)  评论(0编辑  收藏  举报