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

Re: Refereing to elements in current command line



Drew Perttula <drewp@xxxxxxxxxxxxxxx> wrote in news:450198AD.1070104
@bigasterisk.com:

> 
>    cp fredjoesid.php !#$:s/fred/dan
> 
> then tab to check that the last argument expands the way you want
> 
Drew,
Yep that's what I was looking for

Summary AFAICT

For CURRENT line (the # designates current line)

!#:0    command
!#^     first parameter
!#:1    first parameter
!#:1-4  first 4 parameters
!#$     last parameter
!#*     all parameters
!#$:s/bash/zsh

For Previous Command (for comparison)
!!      repeat
!:0     command
!^      first parameter
!:1     first parameter
!:1-4  first 4 parameters
!$      last parameter
!*      all parameters
!!:s/bash/zsh

For last but one command
!-2:2   second parameter of second but last command


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



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