Ideally, it'd be a variation of the following:
:/somesearchstring/ norm! dd
The above searches for a string and performs a normal mode command (in this case, deleting the line). The problem is, this only performs the command on the first occurrence of the search. How do you perform an arbitrary command on the results of a search?
Use :g like so:
:g/somesearchstring/norm! dd
or
:g/somesearchstring/d
See
:h :g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With