[wellylug] vi / ex question

jfouhy at paradise.net.nz jfouhy at paradise.net.nz
Tue Dec 7 16:38:58 NZDT 2004


Quoting jumbophut <jumbophut at gmail.com>:

> What I thought I was doing was:
> 
> 1,$ /$^/d
> 
> i.e. select lines 1 through 'end', and for each line try and match
> /$^/, deleting if matching.
> 
> But as you point out, that doesn't work. It doesn't create an error,
> but it doesn't do what I had hoped. What is actually does is
> highlight all matches for $^, and then delete the first line of the
> file, regardless of content!

I have debian vim 6.3.13.. What that does is delete every line from 1 to the
first one matching the pattern.
(ie: it looks like /$^/ is just replacing the $ in the line range)

If I type that in emacs/viper-mode (which I am actually using), it deletes
everything from line 1 until the first match for /$^/ _after_ the current cursor
position.

Which leads me to believe that it's basically incorrect syntax and you take your
chances as to what it does :-)

-- 
John.




More information about the wellylug mailing list