Say you have this file open in Vim:
The logging helped you figure out an issue and now you want to be rid of the
There’s (not surprisingly) a quick way to do that in Vim:
Any line matching the Vim regular expression
/log/ will be removed.
:g[lobal] runs the given Ex command on the matching lines. In this case, the command is
For more details, see
I’ve only used this to remove lines, but it has all sorts of applications.