====== Donghua's vimrc file ====== 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 =~ '\ ' . arg3 . eq endfunction set nocompatible set nowrapscan "set term=xtermc colorscheme evening " ON syntax highlighting syntax on " ON line number set nu "set incsearch " set trailing whitesapce "set list listchars=tab:\|_,trail:. "" Highlighting whitespaces at end of line highlight WhitespaceEOL ctermbg=red guibg=red match WhitespaceEOL /\s\+$/ highlight ErrorMsg ctermbg=red guibg=red match ErrorMsg /^Error/ " "" Check for extra spaces instead of tabs at the front of the line "match WhitespaceEOL /^\ \+/ " "" Highlight redundant whitespaces. highlight RedundantSpaces ctermbg=red guibg=red match RedundantSpaces /\s\+$\| \+\ze\t/ " Move line up down "map dd-P "map ddp "tabnext tabpre "map :tabp "map :tabn set backspace=indent,eol,start "set restorescreen set t_ti=^[7^[r^[[?47h t_te=^[[?47l^[8 "set ruler "set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%) set virtualedit=all set showmatch set nows set expandtab set tabstop=2 set shiftwidth=2 set autoindent "set smartindent "set ignorecase set ignorecase smartcase "set expandtab "set noexpandtab "set formatoptions=croq "set formatoptions=tcrq " -- JFlex augroup filetype au BufRead,BufNewFile *.flex,*.jflex set filetype=jflex augroup END au Syntax jflex so ~/.vim/syntax/jflex.vim " beep control " set vb t_vb= set vb abbr hte the iabbr #b /*************************************************************** iabbr #e ***************************************************************/ iabbr #c# ################################################################ iabbr #c* #*************************************************************** iabbr #c- #--------------------------------------------------------------- set virtualedit=all "syn keyword szhangTodo TODO FIXME XXX TBD NYI ANNOTATION ABSTRACT contained "hi link szhangTodo Todo set nobackup "danquan map :%s#[A-Z0-9]\{8,\}# & #g {{ :linux:vim:donghua.vim.tar.gz |}}