by teo_zero · 3y ago · 0 comments
:%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?