From: Dominik Vogt <dominik.vogt@gmx.de>
To: zsh-users@sunsite.auc.dk
Subject: Re: up-line-or-search question
Date: Thu, 28 Feb 2002 08:52:21 +0100 [thread overview]
Message-ID: <20020228085221.A11888@lifebits.de> (raw)
In-Reply-To: <20020228074136.C993@lifebits.de>; from dominik.vogt@gmx.de on Thu, Feb 28, 2002 at 07:41:36AM +0100
[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]
On Thu, Feb 28, 2002 at 07:41:36AM +0100, Dominik Vogt wrote:
> On Wed, Feb 27, 2002 at 04:08:06PM +0000, Oliver Kiddle wrote:
> > --- Dominik Vogt <dominik.vogt@gmx.de> wrote:
> > >
> > > Actually, that does not do what I want. I'd need
> > >
> > > up-line-or-history-beginning-search-backward
> > > up-line-or-history-beginning-search-forward
> > >
> > > Since I still want to be able to navigate through the lines in the
> > > ZLE.
> >
> > Is this closer to what you want:
> >
> > up-line-or-beginning-search-backward() {
> > if [[ $LBUFFER == *$'\n'* ]]; then
> > zle up-line-or-history
> > else
> > zle history-beginning-search-backward
> > fi
> > }
> >
> > zle -N up-line-or-beginning-search-backward
> >
> > If it is, this was discussed some time around about last November. A
> > few variations on the idea were posted including a similar function for
> > forward.
>
> It's close, but not exactly what I need. For reference, I have
> attached my final solution including documentation. Since it
> contains tabs, don't simply copy-and-paste it.
I've tinkered a bit mor with it and used the function Bart posted
as the base and came up with a new version that works a tad more
like up-line-or-search. The history-beginning-search-...
functions are only used when one actually typed more than the
first word, i.e.
$ cd /f<Up>
uses history-beginning-search-backward and
$ cd <Up>
uses up-line-or-search
Bye
Dominik ^_^ ^_^
--
Dominik Vogt, email: d.vogt@lifebits.de
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
[-- Attachment #2: zle_updown_funcs.sh --]
[-- Type: application/x-sh, Size: 1110 bytes --]
prev parent reply other threads:[~2002-02-28 8:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-27 8:14 Dominik Vogt
2002-02-27 9:24 ` Goran Koruga
2002-02-27 13:36 ` Dominik Vogt
[not found] ` <3C7CED18.mail4KQ11CK3F@viadomus.com>
2002-02-27 14:44 ` Dominik Vogt
2002-02-27 15:00 ` Anthony R Iano-Fletcher
2002-02-27 16:16 ` Bart Schaefer
2002-02-27 16:08 ` Oliver Kiddle
2002-02-28 6:41 ` Dominik Vogt
2002-02-28 7:52 ` Dominik Vogt [this message]
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=20020228085221.A11888@lifebits.de \
--to=dominik.vogt@gmx.de \
--cc=d.vogt@lifebits.de \
--cc=zsh-users@sunsite.auc.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).