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

Re: run-help as a widget



Hallo Peter,

Peter Stephenson <pws@xxxxxxx> wrote:
> On Mon,  7 Dec 2009 01:57:10 +0100
> JÃrg Sommer <joerg@xxxxxxxxxxxx> wrote:
>> I know, this solution is a dirty hack, but it's quick. The better way is
>> to fix zsh to call run-help with the whole commandline where the alias
>> gets expanded and this commandline gets passed to the second run-help
>> call.
>
> I've been using this for a while, it's perhaps time something along these
> lines got included in Functions/Zle.  I was a bit surprised to find I
> hadn't.
>
> With this it would be worth upgrading run-help and helpers to check if
> there's already a full command line there, and to advance past precommand
> modifiers.  I thought I'd done some of this, too, but maybe not...
> I might simply have been thinking of expansion of aliases.
>
> By the way, note this quotes all buffer words:
>
>   ls foo; rm -rf ~<Esc>h
>
> is safe even if it may not do quite what you actually want, which is quite
> hard to guess.

Isn't it possible to get the position where <Esc>h was hit or the prefix
and the suffix of the command? I would like to get help for true in this
situation:

% for h in $hosts; do ssh $h true<Esc>h; done

Bye, JÃrg.
-- 
Die am Lautesten reden, haben stets am wenigsten zu sagen.



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