Written December 16, 2014. Tagged Vim.
Say you have this file open in Vim:
console.log("about to do two");
console.log("about to do four");
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.