vim-surround icon indicating copy to clipboard operation
vim-surround copied to clipboard

How to surround highlighted text?

Open zer09 opened this issue 4 years ago • 2 comments

Example I have this

const textToBeHighlighted = text[tobehighlighted];

how to surround the text text[tobehighlighted]?

Then the output would be like this.

const textToBeHighlighted = Number(text[tobehighlighted]);

Thanks

zer09 avatar Aug 24 '20 01:08 zer09

const textToBeHighlighted = *text[tobehighlighted];

In normal mode, with the cursor on *, you can do yst;fNumber<cr> or vt;SfNumber<cr>.

Also check the docs. You can find more examples there that in README.

scebotari66 avatar Sep 06 '20 09:09 scebotari66

use the g_ motion to select up through the last non-blank character on the line instead of t; for non colon terminated lines.

pkfm avatar Sep 25 '20 23:09 pkfm