From 19b887667a155befeb5850f0af46a45cc5311ae2 Mon Sep 17 00:00:00 2001 From: Andy Richardson Date: Sun, 4 Dec 2022 13:17:26 +0000 Subject: [PATCH 1/7] Use brew to determine prefix https://docs.brew.sh/FAQ#why-should-i-install-homebrew-in-the-default-location --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f389d6..5667cec 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Install Using the [Homebrew]( https://brew.sh ) package manager: brew install zsh-history-substring-search - echo 'source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc + echo 'source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh): From a7e6d94ba5e1ef8afa31840682f69deffdd1310c Mon Sep 17 00:00:00 2001 From: Padsworth Date: Sun, 25 Jun 2023 15:12:17 -0400 Subject: [PATCH 2/7] updated readme to include Zinit instructions --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 5667cec..9463aaf 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,21 @@ bindkey '^[[B' history-substring-search-down # or '\eOB' HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 ``` +Using [Zinit](https://github.com/zdharma-continuum/zinit): + +1. Use the `Oh-my-zsh` Zinit snippet in `~/.zshrc`: + + zinit snippet OMZ::plugins/git/git.plugin.zsh` + +2. Load the plugin in `~/.zshrc`: + + zinit load 'zsh-users/zsh-history-substring-search + zinit ice wait atload'_history_substring_search_config' + +3. Run `exec zsh` to take changes into account: + + exec zsh + Usage ------------------------------------------------------------------------------ From 8f5d8a5aa9942da7b2a764c7fa79e0f36ba802f7 Mon Sep 17 00:00:00 2001 From: Ilkin Bayramli <43158991+ibayramli@users.noreply.github.com> Date: Tue, 21 Nov 2023 12:54:14 -0500 Subject: [PATCH 3/7] Add Fig as an installation method to the README (#133) * Add Fig as an installation method to the README --------- Co-authored-by: Ilkin Bayramli <43158991+ibayramli2001@users.noreply.github.com> --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 9463aaf..11666f3 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,14 @@ Using the [Homebrew]( https://brew.sh ) package manager: brew install zsh-history-substring-search echo 'source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc +Using [Fig](https://fig.io): + +Fig adds apps, shortcuts, and autocomplete to your existing terminal. + +Install `zsh-history-substring-search` in just one click. + + + Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh): 1. Clone this repository in oh-my-zsh's plugins directory: From 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 Mon Sep 17 00:00:00 2001 From: Arjun Reddy K <45559536+arjunreddyk@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:12:55 +0100 Subject: [PATCH 4/7] Update README.md Remove percent sign (%). The source command should not be prefixed with % symbol. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 11666f3..cfd33b4 100644 --- a/README.md +++ b/README.md @@ -91,13 +91,13 @@ Usage 1. Load this script into your interactive ZSH session: - % source zsh-history-substring-search.zsh + source zsh-history-substring-search.zsh If you want to use [zsh-syntax-highlighting][6] along with this script, then make sure that you load it *before* you load this script: - % source zsh-syntax-highlighting.zsh - % source zsh-history-substring-search.zsh + source zsh-syntax-highlighting.zsh + source zsh-history-substring-search.zsh 2. Bind keyboard shortcuts to this script's functions. From 837d49959ec5d125604ef91c5d967caeb3ad7152 Mon Sep 17 00:00:00 2001 From: darcy Date: Fri, 26 Jan 2024 11:26:14 +1100 Subject: [PATCH 5/7] Fix user input after search Now when a user types `-` directly after searching, it is not treated as a commandline option by `zle` --- zsh-history-substring-search.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh-history-substring-search.zsh b/zsh-history-substring-search.zsh index 471cc9a..ad3d61f 100644 --- a/zsh-history-substring-search.zsh +++ b/zsh-history-substring-search.zsh @@ -406,7 +406,7 @@ _history-substring-search-end() { # For debugging purposes: # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} - # read -k -t 200 && zle -U $REPLY + # read -k -t 200 && zle -U -- $REPLY # # When this function returns, z-sy-h runs its line-pre-redraw hook. It has no @@ -421,7 +421,7 @@ _history-substring-search-end() { # before removing search highlight and exiting. This ensures no highlights # are left lingering after search is finished. # - read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U $REPLY + read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U -- $REPLY region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" ) fi From 3235b885ddd42f912dbb981abd31ab9a098eca85 Mon Sep 17 00:00:00 2001 From: darcy Date: Fri, 16 Feb 2024 12:27:31 +1100 Subject: [PATCH 6/7] Fix user input after search, including `space` key --- zsh-history-substring-search.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh-history-substring-search.zsh b/zsh-history-substring-search.zsh index ad3d61f..2137b79 100644 --- a/zsh-history-substring-search.zsh +++ b/zsh-history-substring-search.zsh @@ -406,7 +406,7 @@ _history-substring-search-end() { # For debugging purposes: # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} - # read -k -t 200 && zle -U -- $REPLY + # read -k -t 200 && zle -U -- "$REPLY" # # When this function returns, z-sy-h runs its line-pre-redraw hook. It has no @@ -421,7 +421,7 @@ _history-substring-search-end() { # before removing search highlight and exiting. This ensures no highlights # are left lingering after search is finished. # - read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U -- $REPLY + read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U -- "$REPLY" region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" ) fi From aa09f04747c0e3326914a895b304498b000c6e70 Mon Sep 17 00:00:00 2001 From: chenxu <6235641+cxwx@users.noreply.github.com> Date: Fri, 5 Dec 2025 09:45:47 +0800 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfd33b4..7a90e1e 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Using [Zinit](https://github.com/zdharma-continuum/zinit): 2. Load the plugin in `~/.zshrc`: - zinit load 'zsh-users/zsh-history-substring-search + zinit load 'zsh-users/zsh-history-substring-search' zinit ice wait atload'_history_substring_search_config' 3. Run `exec zsh` to take changes into account: