Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,
	FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no
	version=3.4.0
X-Injected-Via-Gmane: http://gmane.org/
To: zsh-workers@zsh.org
From: Christian Neukirchen <chneukirchen@gmail.com>
Subject: Re: Announcement of Zsh Command Architect v1.0
Date: Mon, 11 Jan 2016 15:21:37 +0100
Lines: 30
Message-ID: <87r3hourgu.fsf@gmail.com>
References: <CAKc7PVBZf9SQ+7En4nb6WCWv_WX226GtjWqDfTbwNcCKkvuBrg@mail.gmail.com>
	<20160108093313.GA16910__10264.233328826$1452246302$gmane$org@linux.vnet.ibm.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: host248-2.natpool.mwn.de
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")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
X-Seq: zsh-workers 37562

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

