vim ~/.vimrc,添加下面的配置
syntax on
"colorscheme darkblue
set number             " 显示行号
set ruler                   " 打开状态栏标尺
"set cursorline              " 突出显示当前行
set history=50
set fileformats=unix,dos
set fileencodings=utf-8,gb2312,gbk,gb18030  
set termencoding=utf-8 
set encoding=prc
filetype on            " 检测文件类型
filetype  plugin on    " 载入文件类型插件
filetype indent on     " 为特定文件类型载入相关缩进文件
set incsearch       "搜索逐字符高亮
set hlsearch        
set ignorecase      "搜索忽略大小写
set tabstop=4       " 设定 tab 长度为4  
set shiftwidth=4    " 缩进的空格数  
set expandtab       " 是否在缩进和遇到Tab键时使用空格代替;使用noexpandtab取消设置  
set autoindent      " 自动缩进  
set showcmd         " 输入的命令显示出来,看的清楚些 
set showmatch       " 高亮显示匹配的括号
set matchtime=1     " 匹配括号高亮的时间(单位是十分之一秒)