Skip to content

Instantly share code, notes, and snippets.

@c9s
Created January 5, 2010 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c9s/269208 to your computer and use it in GitHub Desktop.
Save c9s/269208 to your computer and use it in GitHub Desktop.
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