Are there any vim plugins to enclose selected text in quotes or parentheses? For instance, if I were to select a block of text in visual mode, and pressed a key combination or do a command, that text would be enclosed in parentheses/quotes.

2 Answers
2

I use surround.vim for this type of thing. For example, visually select an area and type "\s(" and the visually selected text will be enclosed in parenthesis. Change the ( to a double quote and it will use quotes instead.

Unfortunately surround has some slightly odd behaviors, and the help file is sometimes a little unclear, but I find it tolerable.