News for hackers. Stuff that matters.
Re:My Favorite Vim Oneliners for Text Manipulation by teo_zero on Sunday August 06, 2023 @05:20AM (#37020268)
I don't understand the first one:

   :%s/\w\+/\=submatch(0)+1/g | echo line('$')
It doesn't seem to work -- except it says "xxx substitutions", so you can assume it found exactly xxx words. Besides, it changes the original text so you need to undo. Lastly, why is it so complicated? What is the purpose of submatch()? And why echoing the number of the last line?
Re:My Favorite Vim Oneliners for Text Manipulation by ConorSheehan1 on Sunday August 06, 2023 @05:46AM (#37020416)
I also thought this one was weird. I'd just use wc.
Re:My Favorite Vim Oneliners for Text Manipulation by palata on Sunday August 06, 2023 @06:41AM (#37020671)
Or in vim, do `g ctrl+g`.