1. 程式人生 > 其它 >vim配置極簡推薦

vim配置極簡推薦

"設定編碼
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8

"顯示行號
set nu
set number

"突出顯示當前行
set cursorline
set cul          "cursorline的縮寫形式
hi CursorLine   cterm=underline ctermbg=blue ctermfg=white guibg=darkred guifg=white

"突出顯示當前列
"set cursorcolumn
"
set cuc "cursorcolumn的縮寫形式 "hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white "啟用滑鼠 "set mouse=a set selection=exclusive set selectmode=mouse,key "顯示括號匹配 set showmatch "設定Tab長度為4空格 set tabstop=4 "設定自動縮排長度為4空格 set shiftwidth=4 "繼承前一行的縮排方式,適用於多行註釋 set autoindent
"設定貼上模式 set paste "顯示空格和tab鍵 set listchars=tab:>-,trail:- ",eol:$ set list "總是顯示狀態列 set laststatus=2 "顯示游標當前位置 set ruler filetype plugin indent on "讓vimrc配置變更立即生效 autocmd BufWritePost $MYVIMRC source $MYVIMRC