Search code examples
vimparentheses

Enclosing in parentheses with Vim


Is there a way to enclose some text in parentheses (or curly brackets) in vim?

In other words, how would you do this?

Initial string:

It is sunny outside.

Final string:

It is (sunny) outside.

On a funny note, I just hit :w to submit this question.

Happy vim-ing, SOCommunity!


Solution

  • Surround.vim should do the trick. If you want to repeat that with '.', see here.