Tip 915 Printable Monobook Previous Next

created 2005 · complexity basic · author Ethan Mallove · version 6.0

I re-fell in love with :g/ when I discovered norm f{char}. In the following sample text, say you want to delete the two words between the name and the IP address, and "has address" isn't spelled the consistently throughout (preventing us from using :s/has address//). You can do this:

:g/\d\+\.\d\+\.\d\+\.\d\+/norm f w2dw

The above command changes this: has address is address is IP has IP has address has address is address

to this:



Or you could use :s


Actually, this would work ':%g//norm f w2df ', assuming that the columns are separated by spaces instead of tabs.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.