zsh-workers
 help / color / mirror / code / Atom feed
From: Christian Neukirchen <chneukirchen@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: Announcement of Zsh Command Architect v1.0
Date: Mon, 11 Jan 2016 15:21:37 +0100	[thread overview]
Message-ID: <87r3hourgu.fsf@gmail.com> (raw)
In-Reply-To: <20160108093313.GA16910__10264.233328826$1452246302$gmane$org@linux.vnet.ibm.com> (Dominik Vogt's message of "Fri, 8 Jan 2016 10:33:13 +0100")

Dominik Vogt <vogt@linux.vnet.ibm.com> writes:

> To me it appears that cases where a complicated part of a former
> history line needs to be copied and the same cannot easily be done
> with completion is quite rare.  And even then I could just edit
> the complicated line instead of copying a part of it to a new
> line.

I needed this quite often and thus changed my incremental search to
keep the rest of the line and just insert the freshly found line:

# History search with globs.
# 21sep2011  +chris+
# 05jun2012  +chris+  and keeping the rest of the line
autoload -Uz narrow-to-region
_history-incremental-preserving-pattern-search-backward() {
  local state
  MARK=CURSOR  # magick, else multiple ^R don't work
  narrow-to-region -p "$LBUFFER${BUFFER:+>>}" -P "${BUFFER:+<<}$RBUFFER" -S state
  zle end-of-history
  zle history-incremental-pattern-search-backward
  narrow-to-region -R state
}
zle -N _history-incremental-preserving-pattern-search-backward
bindkey "^R" _history-incremental-preserving-pattern-search-backward
bindkey -M isearch "^R" history-incremental-pattern-search-backward
bindkey "^S" history-incremental-pattern-search-forward

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


           reply	other threads:[~2016-01-11 14:39 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20160108093313.GA16910__10264.233328826$1452246302$gmane$org@linux.vnet.ibm.com>]

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=87r3hourgu.fsf@gmail.com \
    --to=chneukirchen@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).