Completion for parentheses, braces and brackets in Vim
Most of the times you are writing code you not only want to open a parenthesis but open and close it. This is the solution I have found for that in Vim.
Anyways, if you want to write a single opening parenthesis, just write '(' twice.
Simply put this in your .vimrc file:
inoremap { {}<left>
inoremap {{ {
inoremap {} {}
inoremap [ []<left>
inoremap [[ [
inoremap [] []
inoremap ( ()<left>
inoremap (( (
inoremap () ()
inoremap " ""<left>
inoremap "" ""
inoremap ' ''<left>
inoremap '' ''
Written by José Luis García
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#