zsh-users
 help / color / mirror / code / Atom feed
From: Dan Nelson <dnelson@emsphone.com>
To: Andrew Main <zefram@tao.co.uk>,
	Shawn Leas <sleas@mn26hp10.honeywell.com>
Cc: thomas@wi3d01.informatik.uni-wuerzburg.de, zsh-users@math.gatech.edu
Subject: Re: HPUX (was Re: vi command line editing)
Date: Wed, 25 Mar 1998 10:01:50 -0600	[thread overview]
Message-ID: <19980325100150.A19966@emsphone.com> (raw)
In-Reply-To: <199803251022.KAA30301@taos.demon.co.uk>; from "Andrew Main" on Wed Mar 25 10:22:49 GMT 1998

In the last episode (Mar 25), Andrew Main said:
> Shawn Leas wrote:
> >bindkey -s "^[OA" "^[ka"
> >bindkey -s "^[OB" "^[ja"
> >bindkey -s "^[OD" "^[ha"
> >bindkey -s "^[OC" "^[la"
> 
> That's a terminal issue.  Some terminals send "^[OA" instead of "^[[A".
> Of course, a lot of terminals send sequences completely different from
> these, but zsh should probably recognise both of these sets by default.

My soution (adjust to your needs):

# usage: bindtc <cap> <default> <zsh-command>
# Binds a termcap entry <cap> to a command.  If the termcap string does 
# not exist, use <default>
bindtc ()
{
    local keyval=$(echotc "$1" 2>&-)
    bindkey "${keyval:-$2}" "$3"
}

# Bindings for UP, DOWN, LEFT, RIGHT
bindtc ku "^[[A" up-line-or-history
bindtc kd "^[[B" down-line-or-history
bindtc kr "^[[C" forward-char
bindtc kl "^[[D" backward-char

	-Dan Nelson
	dnelson@emsphone.com


  reply	other threads:[~1998-03-25 16:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-24 15:14 vi command line editing Stephen Marley
1998-03-24 15:46 ` Andrew Main
1998-03-24 16:26   ` Stephen Marley
1998-03-24 17:06     ` Andrew Main
1998-03-24 18:04       ` Stephen Marley
1998-03-24 18:35         ` Andrew Main
1998-03-24 18:57           ` Thomas Koehler
1998-03-24 19:38             ` Andrew Main
1998-03-24 20:30               ` Thomas Koehler
1998-03-24 22:05                 ` HPUX (was Re: vi command line editing) Shawn Leas
1998-03-24 23:22                   ` Shawn Leas
1998-03-25 10:22                   ` Andrew Main
1998-03-25 16:01                     ` Dan Nelson [this message]
1998-03-25 16:45                     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19980325100150.A19966@emsphone.com \
    --to=dnelson@emsphone.com \
    --cc=sleas@mn26hp10.honeywell.com \
    --cc=thomas@wi3d01.informatik.uni-wuerzburg.de \
    --cc=zefram@tao.co.uk \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).