基本配置:
set nocp
syntax on "语法高亮"
set nocompatible "使用vim的键盘模式"
set nu "设置行号"
set nobackup "不需要备份"
set confirm "未保存或者只读时,弹出确认"
set mouse=a "鼠标可用"
set selection=exclusive
set selectmode=mouse,key
set showcmd "显示未完成命令"
set tabstop=4 "tab为4个空格"
set shiftwidth=4 "行交错"
set cindent "c文件类型自动缩进"
set autoindent "自动对齐"
set smartindent "智能缩进"
set hlsearch "高亮查找匹配"
set background=dark "背景色"
set showmatch "显示匹配"
set ruler "右下角显示光标位置"
set noerrorbells "不发出警告声"
set foldenable
set foldmethod=syntax
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR> "空格控制折叠"
filetype plugin indent on
set fileencodings=gbk,utf-8,gb2312,gb18030,cp936
set termencoding=gbk,utf-8,gb2312,gb18030,cp936