Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Vim to automatically put ending braces?

While editing .scm files it would be great if Vim would automatically put the ending brace ) as soon as I start (. How do I do this?

like image 222
unj2 Avatar asked May 19 '09 15:05

unj2


People also ask

How do I automatically close brackets in vim?

This autocomplete in insert mode, provided set paste is not set. Keep it in the vimrc to avoid typing it every time and when we don't want the mapping, we need to escape it using ctrl + v before typing the mapped char like ( { etc.


1 Answers

You can map the opening brace to your liking:

:imap ( ()<left> 
like image 145
soulmerge Avatar answered Sep 21 '22 07:09

soulmerge