vim how to add text to the beginning of every line

In vim to add text to the beginning of every line is easy.

vim filename
:%s/^/texttoadd/

Be careful with the texttoadd because you might have to escape certain characters.

Comments

Popular posts from this blog

Vim vi how to reload a file your editing