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

Re: Refereing to elements in current command line



zzapper <david@xxxxxxxxxx>:
> Sorry if this is an old chestnut
> I often type somethig like
> 
> > cp fredjoesid.php danjoesid.php
> 
> At Present I use i a binding Control-O to do
> 
> > cp fredjoesid.php fredjoesid.php
> 
> end then vi edit
> But how else can I do this?

Sounds like a job for history-expansion:

[snip]
zsh% touch fredjoesid.php
zsh% cp fredjoesid.php danjoesid.php
zsh% !:0-1 !:1:s^fred^donny
cp fredjoesid.php donnyjoesid.php
zsh% print -l *.php
danjoesid.php
donnyjoesid.php
fredjoesid.php
[snap]

See 'man 1 zshexpn' /HISTORY EXPANSION for details.

Regards, Frank



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