I want to do something in range [a, b] and [c, d], or much more range.
For example, I want to replace "abc" with "def" in lines between 1~10, and lines between 50~60. I will do the two edit operation below:
Can I do this in just one command?
You can't have a non-contiguous range but it's easy enough to repeat the same substitution on another range:
:1,10s/abc/def/g|50,60&&
See :help :&.
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