3

I'm using tpope's surround.vim. Example:

Apply ysip] to

[1 0]
[0 1]

will yield

[
 [1 0]
 [0 1]
 ]

Instead, I'd like to the output to look like

[[1 0]
 [0 1]]

I have also tried this surround with all the visual mode variants I can think of (i.e. vip], VjS], etc.)

and am still having no luck. I'm new to text objects and plugin customizing, and just thought I'd ask of any quick solutions before I try editing the surround file.

Edit: I also found {jv}k$hS] was the general solution for what I needed as a remapping!

1 Answers1

6

AFAIK, the only way to obtain what you want is to select your text in visual mode (not visual-line or visual-block):

v$jS]
romainl
  • 186,200
  • 21
  • 280
  • 313