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

Re: Keyboard Macro?



You could have it in vi edit mode, just do:
bindkey -vs 'cpfl' 'cp _!\^ _!$'

This is one of the things I really dig about zsh: how we can rebind stuff.  I have my zsh set up like my vim setup so that if I press jj it will go from insert mode to command mode.

The function is probably better though anyway.

-fREW

On 4/19/07, zzapper <david@xxxxxxxxxx > wrote:
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx > wrote in
news:070418195155.ZM32237@xxxxxxxxxxxxxxxxxxxxxx:

> }   bindkey -s '^xC' 'cp _!\^ _!$'
>
> or
>     bindkey -s 'cpfl' 'cp _!\^ _!$'
>
> Gotta type it fast, though.
>
> Why not e.g.
>
>     cpfl() {
>       emulate -L zsh
>       local -a last
>       last=( ${(z)history[$[HISTCMD-1]]} )
>       cp -iv $last[2] $last[-1]
>     }
>

thnx implemented Bart's script. the BindKeys didn't work for me, I think it's
because I have vi edit mode enabled?!?


--
zzapper
http://www.rayninfo.co.uk/vimtips.html




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