5 ms·
Why is this preferable to :%s?
by usmannk 6y ago
Why is this preferable to :%s?
- RMPR 6y agoI find it more intuitive, and for a small number of iterations it's definitely faster.
- simias 6y agoIt composes better if you were searching for something and then want to replace it IMO. You basically just have to remember the search syntax and then you can reuse it for replacing. It's also better if you don't actually want to replace in the whole file and there's no convenient shorthand for the range. I very rarely use :s myself, I'm always too worry that I'm going to clobber something I didn't mean to, I prefer to search and manually repeat a substitution. s can do it with with the "c" modifier but I find that using normal edit commands is both more flexible and easier to remember.
- kadonoishi 6y agoIt allows you to use a full Turing machine rather than restricting yourself to a Finite State Machine.