Created
January 5, 2010 07:02
-
-
Save c9s/269208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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