From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17846 invoked by alias); 3 Mar 2014 04:20:16 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18547 Received: (qmail 15987 invoked from network); 3 Mar 2014 04:20:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Jan Larres Subject: Local/global history with pattern isearch Date: Mon, 03 Mar 2014 17:19:53 +1300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: yass.opencloud.co.nz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 Hi, a few months ago there was a discussion about how to use the shared history only for isearch, but not for example for the arrow search. Since I use the history-incremental-pattern-search-backward widget instead of the normal isearch widget the solution didn't work for me, but Bart suggested this instead: zle-line-init() { NUMERIC=1 zle set-local-history } zle -N zle-line-init zle-isearch-update() { NUMERIC=0 zle set-local-history } zle -N zle-isearch-update zle-isearch-exit() { NUMERIC=1 zle set-local-history } zle -N zle-isearch-exit history-incremental-pattern-search-backward() { if [[ $LASTWIDGET != history-incremental-pattern-search-backward ]]; then NUMERIC=0 zle set-local-history fi zle .history-incremental-pattern-search-backward "$@" } zle -N history-incremental-pattern-search-backward bindkey '^r' history-incremental-pattern-search-backward Unfortunately this still isn't quite working for me. It does use the shared history when starting the search, but when pressing ^r again it fails to find any other results, neither in the shared nor in the local history. The custom function also doesn't get called again in that case, I don't know if that's normal behaviour or not. I would be grateful if anyone know how to fix this. Cheers, Jan