Skip to content

Instantly share code, notes, and snippets.

@c9s
Created Jan 5, 2010
Embed
What would you like to do?
inoremap ( ()<ESC>i
inoremap <expr> ) ClosePair(')')
inoremap { {}<ESC>i
inoremap <expr> } ClosePair('}')
inoremap [ []<ESC>i
inoremap <expr> ] ClosePair(']')
inoremap < <><ESC>i
inoremap <expr> > ClosePair('>')
" pair close checker.
" from othree vimrc ( http://github.com/othree/rc/blob/master/osx/.vimrc )
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment