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

Re: The tcsh ^X? command

Dov Grobgeld wrote:
:I'm a new user of zsh and the first thing I tried to do is to make
:sure that everything that I'm used to from tcsh exists. 
:The one thing that got me stuck yesterday is the ^X? command which
:does a 'which ' of the last word and replaces it.
:    ls -l perl^X?
:    ls -l /usr/local/bin/perl
:Is there any way to do the same thing in zsh?

If you have ``setopt equals'' set (it is by default) then

ls -l =perl<TAB>

will do it. 
<TAB> is normally bound to `expand-or-complete' with emacs bindings
or vi-insert-mode bindings.

>From zshexpn manual page:
`If  a word begins with an unquoted = and the EQUALS option'
`is set, the remainder of the word is taken as the name  of'
`a command or alias.  If a command exists by that name, the'
`word is replaced by the full pathname of the command.   If'
`an  alias  exists  by that name, the word is replaced with'
`the text of the alias.'
Geoff Wing [mason@xxxxxxxxxxxxxxx]   PrimeNet - Internet Consultancy
  Web: http://www.primenet.com.au/   Facsimile: +61-3-9819 3788

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