原文地址:http://www.2cto.com/os/201309/246271.html
" This must be first, beacuse it changes other options as a side effect.set nocompatible " show line numbersset number " display "-- INSERT --" when entering insert modeset showmode " incremental searchset incsearch " highlight matching search termsset hlsearch " set ic means case-insensitive search; noic means case-sensitive.set noic " allow backspacing over any character insert modeset backspace=indent,eol,start " do not wrap linesset nowrap " set mouse to work in the console" set mouse=a " keep 50 lines of command line historyset history=50 " show the cursor positionset ruler " save a backup fileset backup " the visual bell flashes the background instead of an audible bell.set visualbell " set sensible defaults for different types of text files.au filetype c set cindent tw=79au filetype sh set ai et sw=4 sts=4 noexpandtabau filetype vim set ai et sw=2 sts=2 noexpandtab " indent new lines to match the current identationset autoindent " don't replace tabs with spacesset noexpandtab " use tabs at the start of a line, spaces elsewhereset smarttab " show syntax highlightingsyntax on " show whitespace at the end of a linehighlight whitespaceEOF ctermbg=blue guibg=bluematch whitespaceEOF /\s\+$/ set tabstop=4set shiftwidth=4set cursorline