Last Updated: June 25, 2016
·
853
· ryrych

Silent find and replace in Vim

Suppose that you call :ReplaceKbd function. The function replaces \<kbd\> with <kbd>. When the pattern is not found you get a message:

Pattern now found: <kbd>

To mute the message out use e flag like this:

:%s/<kbd>/<kbd>/e

This way when the term is not found, no error will be raised.