From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21623 invoked by alias); 11 Feb 2011 16:34:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15797 Received: (qmail 15136 invoked from network); 11 Feb 2011 16:34:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at dan.emsphone.com does not designate permitted sender hosts) Date: Fri, 11 Feb 2011 10:27:26 -0600 From: Dan Nelson To: zzapper Cc: zsh-users@zsh.org Subject: Re: Configuring Keys F1 to F12 Message-ID: <20110211162725.GG66849@dan.emsphone.com> References: <20110210153454.GC17063@layslair.ath.cx> <20110211095705.GD17063@layslair.ath.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 8.2-PRERELEASE User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.96.4 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (email2.allantgroup.com [199.67.51.78]); Fri, 11 Feb 2011 10:27:27 -0600 (CST) X-Scanned-By: MIMEDefang 2.68 on 199.67.51.78 In the last episode (Feb 11), zzapper said: > Anthony Charles wrote in news:20110211095705.GD17063@layslair.ath.cx: > > On Thu, Feb 10, 2011 at 05:39:54PM +0000, zzapper wrote: > >> Anthony Charles wrote in news:20110210153454.GC17063@layslair.ath.cx: > >> > bindkey -s '^v' '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 > > so > bindkey -s "^[[18~" 'ls -l' > > goes into ~/.zshrc You could use something like this: # usage: bindtc bindtc () { local keyval=${termcap[$1]:-$2} [[ -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 to "^[[18~". -- Dan Nelson dnelson@allantgroup.com