zsh-workers
 help / color / mirror / code / Atom feed
From: Jean Chalard <jean.chalard@epita.fr>
To: zsh-workers@sunsite.dk
Cc: Thorsten Kampe <thorsten@thorstenkampe.de>
Subject: Re: .zshrc sanity check
Date: Mon, 5 Apr 2004 17:48:16 +0200	[thread overview]
Message-ID: <20040405154816.GA19743@epita.fr> (raw)
In-Reply-To: <1gyr312onv6xj$.dlg@thorstenkampe.de>

> Just to make myself clear: I'm not looking for an "in-depth analysis",
> just a quick "overhaul" like...

I'm sorry I won't really give you the feedback that you ask for, but
this reminds me of something I wanted to submit a long time ago.

You bind history-beginning-search-backward on the up key. While I find
this really useful (and I don't even imagine using my shell without
this kind of binding, though I use history-search-backward), this has
the drawback that the up arrow doesn't work as expected any more in
zed sessions. It seems to me that many people like this binding, too.

So I had a look at the source of zed, and wrote a little patch to fix
this behaviour. I'm not sure whether zed should be the one doing that,
if it should be done elsewhere or if my configuration is at fault, but
I think many zed users would benefit from this. Sure, I wrote the
patch several months ago, but the code of zed doesn't seem to have
changed since then.

And, er... It seems I used \e[A and \e[B for up and down keys. There
is probably a more portable way to do this that I do not know about,
isn't there?



--- zed	Mon Apr  2 12:04:05 2001
+++ J/zed	Fri Aug  8 17:54:12 2003
@@ -25,7 +25,7 @@
     zstyle ":completion:zed:*" insert-tab yes
 
 # catch interrupts
-cleanup="$(bindkey -L "^M"; bindkey -L -M emacs "^X^W"; bindkey -aL "ZZ"
+cleanup="$(bindkey -L "^M"; bindkey -L -M emacs "^X^W"; bindkey -aL "ZZ"; bindkey -L "^[[A"; bindkey -L "^[[B";
     echo "trap - INT EXIT"; trap)"
 trap "return 130" INT
 trap "$cleanup" EXIT
@@ -37,6 +37,8 @@
 # Depending on your stty's, you may be able to use ^J as accept-line, else:
 bindkey -M emacs "^X^W" accept-line
 bindkey -a "ZZ" accept-line
+bindkey "^[[A" up-line-or-history
+bindkey "^[[B" down-line-or-history
 
 if ((fun)) then
   var="$(functions $1)"

-- 
J
"Pour le jeune, de l'eau, évidemment !"


       reply	other threads:[~2004-04-05 15:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1gyr312onv6xj$.dlg@thorstenkampe.de>
2004-04-05 15:48 ` Jean Chalard [this message]
2004-04-05 17:50   ` PATCH: " Peter Stephenson
2004-04-05 18:04     ` Peter Stephenson
2004-04-06  9:04     ` Jean Chalard

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=20040405154816.GA19743@epita.fr \
    --to=jean.chalard@epita.fr \
    --cc=thorsten@thorstenkampe.de \
    --cc=zsh-workers@sunsite.dk \
    /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).