zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: shared history but recalling history in current terminal
Date: Mon, 09 Dec 2013 23:09:27 -0800	[thread overview]
Message-ID: <131209230927.ZM8394@torch.brasslantern.com> (raw)
In-Reply-To: <l830ra$89p$1@ger.gmane.org>

On Dec 9, 12:54pm, Jan Larres wrote:
} Subject: Re: shared history but recalling history in current terminal
}
} After some more investigation I noticed that unsetting local-history
} does actually work, but re-running the widget after entering something
} does not. So if I have this in my zshrc:
} 
}   bindkey '^r' history-incremental-pattern-search-backward
} 
} If I then press ^r and enter some word it gets correctly found in the
} global history, but if I press ^r again to search for an earlier
} occurence it always fails. Is there any way to fix this?

Since (as previously discussed) we don't have a hook for isearch-init,
the only way to fix that one is to rebind the widget:

    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

I haven't actually tested that but it should be close to something that
works ...


      reply	other threads:[~2013-12-10  7:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 20:30 shawn wilson
2013-11-27  6:31 ` Wayne Davison
2013-11-27  8:02   ` Bart Schaefer
2013-11-27 13:49     ` shawn wilson
2013-11-27 15:11       ` Karoly Negyesi
2013-11-27 15:17         ` shawn wilson
2013-11-27 18:24         ` Bart Schaefer
2013-11-27 19:08     ` René 'Necoro' Neumann
2013-11-28  1:05       ` Bart Schaefer
2013-11-28 20:44         ` René 'Necoro' Neumann
2013-11-28 21:33           ` Bart Schaefer
2013-11-30 11:03             ` René 'Necoro' Neumann
2013-11-30 19:07               ` Bart Schaefer
2013-12-08 23:40             ` Jan Larres
2013-12-08 23:54               ` Jan Larres
2013-12-10  7:09                 ` 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=131209230927.ZM8394@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).