Delete lines containing a pattern in vim

published on January 08, 2020.

Today I had to delete all lines from a CSV file where the last column has a 1:

:g/1$/d

While short, I can't remember this syntax as I have to search for it every time. I'll try to remember this as “grep for a pattern, and delete” for next time.

Happy hackin’!

Tags: vim, grep, delete.
Categories: Software, Development.

Thanks for reading! I would like to help you make your web application better, so let's talk.

Robert Basic

Robert Basic

Software developer making web applications better.

Let's work together!

I would like to help you make your web application better.

Robert Basic © 2008 — 2020
Get the feed