Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to rebind ctrl-d in .zshrc?
- X-seq: zsh-users 14504
- From: Guido van Steen <gvsteen@xxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: How to rebind ctrl-d in .zshrc?
- Date: Fri, 16 Oct 2009 07:30:12 -0700 (PDT)
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1255703412; bh=mQoSsBbcdbOW74Hg+7xE214N2K7VuifHWi8ixVYA96k=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=R1LuYUUWkbaWHOZLHczU9ma0z1GejsPIuQZ9AUWJwH8CAIwf1uMQXC8iKxnwtdaosX+NsP3Slqvps8lGO98sNKNDbkJgDsJGKDkHSP6jHyz8yIAgWBEY4vV48WaD7S4dBNS5o8SQR6iqmuGsot/NthSClLCcp5SKyC6yPpb8v4Q=
- 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:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=xcJJQ8t4nTfkXvDp2pBF+danwwLEElVYMIsM9SAdw3LzRSgHvdl//1jzEPTJWPBkniaBfCDZBywXKvzzlV7Cp+FmiCQH3M6ORWJEzKoJpqWcZvSoY7SQ/SIjY7e13Ck1RxzZ+68VpBOJQmOhuy+O1nFssbg7j+icKhHPNHufIM4=;
- In-reply-to: <237967ef0910151516n42ec231obdd48da9d63087e6@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi Mikael,
Exactly what I was looking for! Thanks a lot!
I have another kind of related question:
Is is possible to rebind/extend ctrl-d in .zshrc or somewhere
else too??
Cheers!
Guido
--- On Fri, 16/10/09, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> From: Mikael Magnusson <mikachu@xxxxxxxxx>
> Subject: Re: How to rebind the hyphen in .zshrc?
> To: "Guido van Steen" <gvsteen@xxxxxxxxx>
> Cc: "ZSH User List" <zsh-users@xxxxxxxxxx>
> Date: Friday, 16 October, 2009, 5:16 AM
> 2009/10/16 Guido van Steen <gvsteen@xxxxxxxxx>:
> > Dear all,
> >
> > In my .zshrc file I would like to include something
> like:
> >
> > rebind-hyphen {
> > # intended pre-processing
> > zle .self-insert
> > # intended post-processing
> > }
> >
> > zle -N rebind-hyphen
> > bindkey "-" rebind-hyphen
> >
> > This produces the following error:
> >
> > "rebind-hyphen" undefined-key
> >
> > If I add:
> >
> > bindkey "a" rebind-hyphen
> >
> > or
> >
> > bindkey " " rebind-hyphen
> >
> > there is no error at all and "a" or " " gets bound.
> >
> > So, I guess hyphen must be a special input character
> to zsh.
> >
> > Is there a way around this??
> >
> > Thanks!
> >
> > Guido
>
> The trick is a - starts an option, so you have to say you
> aren't
> giving any more options with the standard method:
> bindkey -- - whatever
>
> You have to do that when aliasing something beginning with
> + or - too:
> alias -- +x='chmod +x'
>
> I just noticed now though that I had just one hyphen in my
> .zshrc and
> that works too, so I'm not sure which is canonical, both
> appear to
> work though.
>
> --
> Mikael Magnusson
>
Send instant messages to your online friends http://uk.messenger.yahoo.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author