Zsh Mailing List Archive
Messages sorted by:
Re: Configuring Keys F1 to F12
- X-seq: zsh-users 15797
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: Configuring Keys F1 to F12
- Date: Fri, 11 Feb 2011 10:27:26 -0600
- Cc: zsh-users@xxxxxxx
- In-reply-to: <Xns9E8998F98F3E5zzappergmailcom@184.108.40.206>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <Xns9E8895882A0D5zzappergmailcom@220.127.116.11> <20110210153454.GC17063@layslair.ath.cx> <Xns9E88B3AEAD3E0zzappergmailcom@18.104.22.168> <20110211095705.GD17063@layslair.ath.cx> <Xns9E8998F98F3E5zzappergmailcom@22.214.171.124>
In the last episode (Feb 11), zzapper said:
> Anthony Charles wrote in news:20110211095705.GD17063@xxxxxxxxxxxxxxx:
> > On Thu, Feb 10, 2011 at 05:39:54PM +0000, zzapper wrote:
> >> Anthony Charles wrote in news:20110210153454.GC17063@xxxxxxxxxxxxxxx:
> >> > bindkey -s '^v<F7>' 'ls -l'
> >> Anthony thanks works a treat:-
> >> what I failed to realise is that you have to actually type
> >> (Control-v F7)
> >> which on my system displays as:-
> >> bindkey -s "^[[18~" 'ls -l'
> >> Yhis is going to be hyper useful : thanks
> > You're welcome, sorry for being unclear.
> Anthony my fault not yours; I've just realized where I was BLOCKING!
> I was trying to enter the bindkey straight into my zsh config file whereas
> i should have been generating the key sequence on the command line
> bindkey -s "^[[18~" 'ls -l'
> goes into ~/.zshrc
You could use something like this:
# usage: bindtc <cap> <default> <string>
[[ -n $keyval ]] bindkey -s $keyval $3
I use something similar to bind commands to things like pgup and pgdn, whose
escape sequences vary across terminals. With it, you can run:
bindtc k7 "^[[18~" 'ls -l'
which will use the termcap entry for F7, or if it's missing, will fall back
Messages sorted by: