News for hackers. Stuff that matters.
Re:Ask HN: Is Vim still worth learning? by tomn on Tuesday December 13, 2022 @07:35AM (#33968061)
Surround is a plugin which adds more text objects: https://github.com/tpope/vim-surround

cs"': change surrounding quotes, e.g. "foo" -> 'foo'

cs([: change surrounding brackets, e.g. (foo) -> [ foo ]

( cs]) would omit the spaces)

ci": change in quotes, e.g. "foo" -> "" (in insert mode between the quotes)

ca": change around quotes, e.g. x"foo"y -> xy (in insert mode between x and y

viWS<tag>: add tag around current word using visual mode, e.g. foo -> <tag>foo</tag>

dst: delete surrounding tag, e.g. <tag>foo</tag> -> foo

It's really good. I'm not familiar with argument.

There are no comments on this comment yet.