vim-surround
vim-surround copied to clipboard
How to surround highlighted text?
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
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.
use the g_ motion to select up through the last non-blank character on the line instead of t; for non colon terminated lines.