Am 10. April 2014 in Musik.
Addendum to my previous post
I received a message from a reader who goes by the name of “bw1″ who points out that my task “to delete all lines in the current file not containing the string foo” can easily be accomplished by issuing this command
I should read the VIm documentation once in a while!
I want to delete all lines in the current file not containing the string foo:
Explanation: Using the global command g (“act on range or entire file”) like :g/pattern/d applies the command d (“delete line”) to any line in the current file that matches pattern.
Since VIm generally does not support inverting RegExps (for example like sed does with the modifier !), I employ the “negative lookahead operator” @! (that has to be escaped \@!) of VIm-RegExp-syntax.
Since, in VIm RegExp syntax, look-ahead must follow something (why? I don’t know) I precede it with ^.*, but this is not enough, since it renders the obscure error E62: Nested \@ (why? I don’t know).
But it works if I make the preceeding term optional using the ? modifier. It’s a horribly inefficient RegExp, but it’s shortest to write (which is what VI-commands are all about).
And now you know that, too.
P.S.: If you know a shorter version let me know - FYI, I already know
and it does not count – VIm onboard stuff only!
Am 22. Februar 2014 in Musik.
Count to 600:
- “Hypnosis (5 Minutes)“, MP3, 5:00min.
Note: Contains samples from Masato Hagiwara in Kiyoshi Kurosawa’s “Kyua” (Japan, 1997).
I have updated my YouTube Userstyle to the latest names they have given to their BS.
You can visit the style’s entry at userstyles.org for review and installation:
See also: Original announcement (20 Nov 2013).