Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to make underlining of a command line disappear after an ordinary key press? (2)
- X-seq: zsh-users 14487
- From: Guido van Steen <gvsteen@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: How to make underlining of a command line disappear after an ordinary key press? (2)
- Date: Mon, 12 Oct 2009 13:46:03 -0700 (PDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1255380363; bh=NfXJiyufrMoGaY5RDRAv7+Y5tBcfbi7YkH/Ezh3/SWc=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=J9ycaHAWLSwPWQbSVbVAIkY7HMKvNjrde5QLmv9vTCw1AGnepBXmBGG1Rfx/RYLYLzrgNRvVCqub05R9QHe4c0+lzX5UADsK5U1FWJjPQPqU/xK1jfmL+Z/nzv5ailwK0E2qD9EuStoh+gEFPr1aVknBrOgJ/A7jbmMC8XLILUM=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Kwc+52cHm1Cmjg6PV9NPm7xMeo6oWiG5k/LmRXsuShrKePKx2oNpl/pq8klsEQ7nyLWIVSxaxWQlQxPz3C4gHqceGpuIUq4yMgUufXCeMsmm+V/NcWdQdRDY5DkMSdeDm8y+c9K75uaNiPaUi7kMOOzuIwjQ+BIe348wfoTVOP8=;
- In-reply-to: <200910120903.n9C93meM015828@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi Peter,
So, this would be the best way to rebind the space bar as well:
"""space-key-press(){
if [[ $KEYS = " " ]]; then
zle rebind-spacebar
fi
zle .self-insert
}
zle -N self-insert space-key-press
"""
Thank you!
Guido
--- On Mon, 12/10/09, Peter Stephenson <pws@xxxxxxx> wrote:
> From: Peter Stephenson <pws@xxxxxxx>
> Subject: Re: How to make underlining of a command line disappear after an ordinary key press? (2)
> To: zsh-users@xxxxxxxxxx
> Date: Monday, 12 October, 2009, 4:03 PM
> Guido van Steen wrote:
> > ordinary-key-press(){
> > if [[ $KEYS = [[:print:]] ]]; then
> >
> region_highlight=("0 0 underline")
> > fi
> > zle .self-insert
> > }
> >
> > zle -N .self-insert ordinary-key-press
>
> You *don't* want the "." in the zle -N. The whole
> point of the
> dot-commands is that they can't be replaced by user
> widgets. That's
> the same reason you *do* want it in the function.
>
> ordinary-key-press(){
> if [[ $KEYS = [[:print:]] ]];
> then
>
> region_highlight=("0 0 underline")
> fi
> zle .self-insert
> }
>
> zle -N self-insert ordinary-key-press
>
> There's nothing special about space so long as it's bound
> to
> self-insert; I had no trouble using it.
>
> By the way, if you ever need to undo this, the incantation
> is
>
> zle -A .self-insert self-insert
>
> ---don't simply delete self-insert or you will have trouble
> typing.
>
> --
> Peter Stephenson <pws@xxxxxxx>
> Software Engineer
> Tel: +44 (0)1223 692070
> Cambridge Silicon
> Radio Limited
> Churchill House, Cambridge Business Park, Cowley Road,
> Cambridge, CB4 0WZ, UK
>
>
> Member of the CSR plc group of companies. CSR plc
> registered in England and Wales, registered number 4187346,
> registered office Churchill House, Cambridge Business Park,
> Cowley Road, Cambridge, CB4 0WZ, United Kingdom
>
New Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author