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?
Really simple and clever, made me smile.
Zsolt Botykai
2009-05-19 20:55:13
The plugins mentioned in the other answers have the advantage of behaving "intelligently" when typing the corresponding closing ")". If this is not needed, then I'd also go with the straigt forward map.
2009-05-20 10:54:07
Some plugins also : - don't expand within comment and string contexts, - define a way to surround the selection with a pair of brackets, - inserts a placeholder/marker in order to jump past the closing bracket (which is consistent with most snippets/templates expander plugins).
Luc Hermitte
2009-05-20 19:18:06
+4
A:
There are many tips and plugins on the subject. Have a look at the relevant entry in the vimtips site.
Luc Hermitte
2009-05-19 16:33:39
+5
A:
I needed one too, and I already tried a few of the plug-ins:
AutoClose, http://www.vim.org/scripts/script.php?script_id=1849, is a bit aggressive.
simple pairs, http://www.vim.org/scripts/script.php?script_id=2339, depends on Python. If you are on Linux it is not a problem, but on Windows it can be a trouble to match the Vim version to the Python interpreter you have.
My advice would be ClosePairs, that you can find at http://www.vim.org/scripts/script.php?script_id=2373 which has been working perfectly for me. It is simple and useful.
Caglar Toklu
2009-05-19 21:38:40