您的位置:首页 > 其它

我的VIM编辑器配置文件 _vrimrc

2014-02-19 16:54 344 查看
source $VIMRUNTIME/vimrc_example.vim

source $VIMRUNTIME/mswin.vim

behave mswin

set nocompatible "use vim defaults = set nocp

set ls=2 "always show status line

set tabstop=4 "numbers of spaces of tab character

set shiftwidth=4 "numbers of spaces to (auto)indent

set scrolloff=3 "keep 3 lines when scrolling

set showcmd "display incomplete commands

set hlsearch "higlight searches

set incsearch "do incremental searching

set ruler "show the cursor position all the time

set nobackup "do not keep a backup file

set number "show line numbers

set ignorecase "ignore case when searching

"set noignorecase "don't ignore case

set title "show title in console titile bar

set ttyfast "smoother changes

"set ttyscroll=0 "tun off scrolling didn't work well with PuTTY

set modeline "last lines in document sets vim mode

set modelines=3 "number lines checked for modelines

"set autoindent "always set autoindenting on

"set smartindent "smart indent

"set cindent "cindent

set noautoindent "noautoindent

set nosmartindent "nosmartindent

set nocindent "nocindent

"set autowrite "auto savas changes when quitting and swiching

"set expandtab "tabs are converted to spaces,use only when rq

"set sm "show matching braces,somewhat annoying...

"set nowrap "don't wrap line

syntax on "syntax higlighing

set encoding=utf-8 "enable utf-8 encode,this is refer to charset encoding,not files.

set tw=78

set lbr

set fo+=mB

colo torte "default color

"set guifont=

set guifont=Source\ Code\ Pro:h12

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: