Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Expanding global aliases on key press
- X-seq: zsh-users 13879
- From: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Expanding global aliases on key press
- Date: Wed, 25 Feb 2009 18:21:10 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <go20an$4p6$1@xxxxxxxxxxxxx> <090224174147.ZM8152@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
* Bart Schaefer (Tue, 24 Feb 2009 17:41:47 -0800)
> } Additionally I've adapted this widget to be bound to the Enter key:
> }
> } #
> } accept-line()
> } { local ga="$LBUFFER[(w)-1]"
> } [[ -n $ga ]] && LBUFFER[(w)-1]="${${galiases[$ga]}:-$ga}"
> } zle .accept-line;}
> }
> } zle -N accept-line
> } #
> }
> } I'd also like to hear your comments on that...
>
> I was going to ask "why?" since you can't do anything with the expanded
> alias after accepting the line, whereas with global-alias-space you
> can at least edit it.
It just looks nicer in the terminal window - not just in history but
also when someone looks over your shoulder or you demonstrate stuff.
Global aliases are hugely useful and I always use them when I switch to
bash or Take Command - and then realize that they - of course - don't
work there.
Compare this:
h -dE 0 G hex L
h -dE 0 | grep hex | less
The former is easier to type but the latter is easier to read.
Thorsten
Messages sorted by:
Reverse Date,
Date,
Thread,
Author