how do i quantify the replacement portion of a vim search/replace expression?
:%s/x\{4\}/yyyy/g
will replace every occurrence of 4 x's with 4 y's.
:%s/x\{4\}/y\{4\}/g
replaces the 4 x's with "y{4}"
how do i modify that so that i do not have to insert 4 separate y's but instead "quantify" a single y.
The solution seems more troublesome than its worth:
:%s/w\{4}/\=repeat('y',4)/g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With