Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: .zshrc sanity check
- X-seq: zsh-workers 19729
- From: Jean Chalard <jean.chalard@xxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: .zshrc sanity check
- Date: Mon, 5 Apr 2004 17:48:16 +0200
- Cc: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- In-reply-to: <1gyr312onv6xj$.dlg@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <1gyr312onv6xj$.dlg@xxxxxxxxxxxxxxxx>
> 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 !"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author