vimrc

2017-12-25  本文已影响14人  极速魔法

set nu

syntax on
set fileencoding=utf-8
set showcmd
set cmdheight=1

set mouse=a
set ignorecase
set hlsearch
set nobackup
set smarttab

set tabstop=4
set softtabstop=4
set shiftwidth=4

set confirm
set autoindent
set cindent
set completeopt=preview,menu

set noeb
set smartindent

:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {<CR>}<ESC>O
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "<Right>"
else
return a:char
endif
endfunction

上一篇 下一篇

猜你喜欢

热点阅读