打开vim的配置文件(在根目录的etc/ 下的vim目录下,用vim打开vimrc文件),加入一下配置:
[第一部分]
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set cindent
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
set nu '如果想显示行号
if &term=="xterm"
et t_Co=8
set t_Sb=^[[4%dmset t_Sf=^[[3%dm
[第二部分]
自动补全:
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {<CR>}<ESC>O
"设置跳出自动补全的括号
func SkipPair()
if getline('.')[col('.') - 1] == ')' || getline('.')[col('.') - 1] == ']' || getline('.')[col('.') - 1] == '"' || getline('.')[col('.') - 1] == "'" || getline('.')[col('.') - 1] == '}'
return "\<ESC>la"
else
return "\t"
endif
endfunc
" 将tab键绑定为跳出括号inoremap <TAB> <c-r>=SkipPair()<CR>
[第三部分]
:set mouse-=a
配置vim
最新推荐文章于 2022-11-03 12:00:20 发布