Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Can I refer to last but one parameter?



Peter Stephenson <pws@xxxxxxx> wrote in 
news:20070227124408.4414e740.pws@xxxxxxx:

> zzapper <david@xxxxxxxxxx> wrote:
>> Hi
>> 
>> Can I refer to last but one parameter?
>> 
>> e.g.
>> 
>> vi !$-1  ## wrong does not work
> 
> You have to count from the start of the line and used !:<argnum>.
> 
> "-" refers exclusively to ranges, even if one of the arguments is missing,
> so for example !:-1 means the range of words 0 (the command word) and 1,
> while !:$-1 is the not very useful range from the last to the the first
> argument.
> 


 the answer is no then?

I wanted to do this with rather a mucky line where counting from 0 was a 
chore


-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Messages sorted by: Reverse Date, Date, Thread, Author