'设置编码'set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936set termencoding=utf-8set encoding=utf-8'显示行号'set nu'突出显示当前行'set cul'突出显示当前列'set cuc'启用鼠标'set mouse=aset selection=exclusiveset selectmode=mouse,key'显示括号匹配'set showmatch'设置Tab长度为4空格'set tabstop=4'设置自动缩进长度为4空格'set shiftwidth=4'继承前一行的缩进方式,适用于多行注释'set autoindent'设置粘贴模式'set paste'显示空格和tab键'set listchars=tab:>-,trail:-'显示字符'set list'总是显示状态栏'set laststatus=2'显示光标当前位置'set ruler'打开文件类型检测'filetype plugin indent on'让vimrc配置变更立即生效'autocmd BufWritePost $MYVIMRC source $MYVIMRC'Vim高亮搜索'set hlsearch
运行 C/C++ 代码
nnoremap <F9> <Esc>:w<CR>:!g++ % -o /tmp/a.out && /tmp/a.out<CR>nnoremap <F8> <Esc>:w<CR>:!gcc % -o /tmp/a.out && /tmp/a.out<CR>
% 会自动解析成为 当前文件名
