Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim Surround inserts extra space around the word

Tags:

vim

surround

When I select the word and use the surround plugin with S:

foobar 

It becomes

( foobar ) 

How do I remove the extra spaces, so that it becomes

(foobar) 

What should I place in my settings?

like image 778
Kit Avatar asked Feb 06 '12 17:02

Kit


2 Answers

If you type S(, it will be surrounded by spaces. However if you use the closing ) instead S) it will not be surrounded by spaces.

This applies of course to all bracket pair surroundings, <> [] {} (), not merely to (), although the behavior of S< is such that it expects a tag enclosure so only S> is able to surround as <>.

like image 171
Michael Berkowski Avatar answered Sep 19 '22 15:09

Michael Berkowski


When you use the surround plugin you can use:

cs) instead of cs( to surround without space :).

like image 38
Ahmed Masud Avatar answered Sep 20 '22 15:09

Ahmed Masud