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

Re: Expanding global aliases on key press



* 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