zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-users@sunsite.auc.dk
Subject: Re: is there a mix of history-search-backward and history-beginning-search-backward
Date: Wed, 8 Sep 1999 15:55:37 +0000	[thread overview]
Message-ID: <990908155537.ZM13525@candle.brasslantern.com> (raw)
In-Reply-To: <19990908150213.D4878@br-online.de>

On Sep 8,  3:02pm, Andy Spiegl wrote:
} Subject: Re: is there a mix of history-search-backward and history-beginni
}
} Hi again!

Hello ...

} A while ago I asked:
} > 
} > I want to bind to ^P a widget that acts like
} > history-beginning-search-backward, but always moves the cursor to the end
} > of the line, like history-search-backward does.  Or said the other way:
} > I want history-search-backward to look at more than the first word.
} > 
} > Do you know a way to get this behavior?
} 
} Does noone have any idea about this?

Everyone is probably waiting for everyone else to answer.  Now you'll
probably get this answer several times.

In 3.0.6, there really is no satisfactory way to get this behavior.  The
closest you can come is to use this kind of binding:

	bindkey '^Xp' history-beginning-search-backward
	bindkey -s '^P' '^X^X^Xp^E'

The first binding is just something to hang the real thing you want to
execute on, so that you can refer to it in the second binding.  The second
binding maps ctrl-P to the sequence exchange-point-and-mark (^X^X) followed
by history-beginning-search-backward (^Xp) followed by end-of-line (^E).
The problem is that you have to remember to set the mark with ctrl-space
(or whatever you have bound to set-mark-command) before you begin to press
ctrl-P repeatedly, or exchange-point-and-mark will jump to the wrong place:
zsh resets the mark each time a new prompt is displayed.

In 3.1.6, you can create a custom widget as I just saw that PWS has already
explained, so I won't repeat him.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


      parent reply	other threads:[~1999-09-08 15:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-03 11:04 Andy Spiegl
1999-09-08 13:02 ` Andy Spiegl
1999-09-08 15:27   ` Peter Stephenson
1999-09-08 15:55     ` Andy Spiegl
1999-09-08 16:18       ` Oliver Kiddle
1999-09-08 16:58       ` unsubscribe tbabin@nortelnetworks.com Timothy Babin
1999-09-11 22:58     ` is there a mix of history-search-backward and history-beginning-search-backward Bart Schaefer
1999-09-08 15:55   ` Bart Schaefer [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=990908155537.ZM13525@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --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).