vim

Ranges in Vim

Although I briefly mentioned the concept of range in my previous article about substitutions, I simply described them as a “set of lines”, on each of which the :substitute command would be called. But amongst the (much appreciated) feedback I received on reddit , some mentioned the fact that this somewhat hand-wavy explanation was not enough, and that I should elaborate. This in turn made me realize that everything about ranges was not clear for me.
Read more

Vim Substitute Tricks

I use Vim to edit text every day, and the good old :[range]s[ubstitute]/pattern/string/flags command is without doubt one of the commands I use the most. It is simple yet powerful, and when combined with the g flag allows me to replace everything I want on an arbitrary selection (or on the whole file using :%s/pattern/replacement/g). But I recently realized that, despite using it a lot, I was far from leveraging its full potential.
Read more