Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: run-help as a widget
- X-seq: zsh-workers 27534
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: JÃrg Sommer <joerg@xxxxxxxxxxxx>
- Subject: Re: run-help as a widget
- Date: Sat, 19 Dec 2009 00:28:35 +0100
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=D0pYAAZFVKhukcyZ5TBlLP3W86RJXTQoHf7XKBGYLwE=; b=p9CBynm48r+4UHSPe3KVsdjOFOGQy+H3CeITw3T3QO3wYA7Ei5QRPLshmGzKx1R+F3 g9uMDfjoMNYNhkZh38XrxqRK/7SopczLKrmclnho2kfH44QwvDVlAggIa7RnUeHeNkt8 AXTO0CAQ4sm7IOUlGxLGu8bqDkDilw46fKT+A=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=dBikqZEw3jVc2Ybf3BcAacHy1/gf/XUnQozxaQsYitlf6zx8KEtGXJgEZQ7+Q5iU8m YmZFSGofhF0etoJ6f3/CptvWWEbyWfYT+d0P317vdbepZSfyVDCwZRTvkxiQzCa1aGH3 +Ps8WBe5sMWunM4fOu4DwktIHNcmUth8m1Btg=
- In-reply-to: <slrnhind7f.246.joerg@xxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <a355a85f3bdb0aac910702825eeb0b302ba155a9.1260147415.git.joerg@xxxxxxxxxxxx> <20091216115900.45764c25@news01> <slrnhind7f.246.joerg@xxxxxxxxxxxx>
2009/12/18 JÃrg Sommer <joerg@xxxxxxxxxxxx>:
> 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
I had _split_shell_arguments_under already:
autoload -U split-shell-arguments
function _split_shell_arguments_under()
{
local -a reply
integer REPLY2
split-shell-arguments
#have to duplicate some of modify-current-argument to get the word
#_under_ the cursor, not after.
setopt localoptions noksharrays multibyte
if (( REPLY > 1 )); then
if (( REPLY & 1 )); then
(( REPLY-- ))
fi
fi
REPLY=${(Q)reply[$REPLY]}
}
function helpme()
{
local REPLY
_split_shell_arguments_under
run-help $REPLY
}
zle -N helpme
bindkey '^Xh' helpme
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author