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

Re: "Alt ." to repeat last part of a command



2010/4/23 Jérémie Roquet <arkanosis@xxxxxxxxx>:
> 2010/4/23 Carlo Trimarchi <mr.spoon21@xxxxxxxxx>:
>> how can I use the "Alt ." combination to repeat the last part of a
>> command? When I used bash I used a lot this.
>> Or, maybe, is there any other combination in zsh to do the same thing?
>
> Not sure I understood what you mean, but maybe :
>
> bindkey -s '^[.' '!#$'

Or

bindkey -s '^[.' '!$'

if you want the last part of the /previous/ command

function last-arg()
{
    LBUFFER+=' !$'
    zle complete-word
}
zle -N last-arg
bindkey '^[.' last-arg

not to have to press <space> and <tab>

-- 
Jérémie



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