"==================================
""" VIM 基本配置
"===================================
""" 关闭 vi 的一致性模式 避免以前版本的一些 Bug 和局限
set nocompatible
" 配置 backspace 键工作方式
"set backspace=indent,eol,start
""" 显示行号
set number
" 设置在编辑过程中右下角显示光标的行列信息
"set ruler
"" 当一行文字很长时取消换行
"set nowrap
""" 在状态栏显示正在输入的命令
set showcmd
" 设置历史记录条数
"set history=1000
""" 设置取消备份 禁止临时文件生成
- set nobackup
- set noswapfile
" 突出现实当前行列
- "set cursorline
- ""set cursorcolumn
" 设置匹配模式 类似当输入一个左括号时会匹配相应的那个右括号
"set showmatch
""" 设置 C/C++ 方式自动对齐
- set autoindent
- set cindent
" 开启语法高亮功能
- "syntax enable
- "syntax on
""" 指定配色方案为 256 色
set t_Co=256
" 设置搜索时忽略大小写
"set ignorecase
""" 设置在 VIM 中可以使用鼠标 防止在 Linux 终端下无法拷贝
set mouse=a
" 设置 Tab 宽度
"set tabstop=4
"" 设置自动对齐空格数
set shiftwidth=4
" 设置按退格键时可以一次删除 4 个空格
"set softtabstop=4
"" 设置按退格键时可以一次删除 4 个空格
set smarttab
" 将 Tab 键自动转换成空格 真正需要 Tab 键时使用 [Ctrl + V + Tab]
"set expandtab
""" 设置编码方式
set encoding=utf-8
" 自动判断编码时 依次尝试一下编码
"set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
""" 设置换行符为 unix
set ff=unix
" 检测文件类型
"filetype on
"" 针对不同的文件采用不同的缩进方式
filetype indent on
" 允许插件
"filetype plugin on
"" 启动智能补全
filetype plugin indent on
来源: http://www.bubuko.com/infodetail-2865417.html