Search this site

Metadata

Articles

Projects

Presentations

More vim fun...

the ! command is awesome. It lets you filter a given number of lines (or characters) through an external program. Here's an example: Let's say we have a file that has blank lines on it and we want to remove those blank lines? Here's what the file I made looks like:
Hello there

How are you



Plz kthx?

So, we want those blank lines gone, right? We can use the ! command with grep to do that! Type this:
!Ggrep -v '^$'

Now we're set, the result should look like this:
Hello there
How are you
Plz kthx?

0 responses to 'More vim fun...'

Showing last 0 comments... (Click here to view all comments)


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment: