Compare commits

...

10 commits

Author SHA1 Message Date
Suraj N. Kurapati
14c8d2e0ff
Merge pull request #175 from cxwx/patch-1
Update README.md to fix forgotten single quote mark.
2026-01-15 09:44:55 -08:00
chenxu
aa09f04747
Update README.md 2025-12-05 09:45:47 +08:00
Guido van Steen
87ce96b186
Merge pull request #159 from dxrcy/master
Fix user input after search
2024-06-05 07:04:53 +02:00
darcy
3235b885dd Fix user input after search, including space key 2024-02-16 12:27:31 +11:00
darcy
837d49959e Fix user input after search
Now when a user types `-` directly after searching, it is not treated as a commandline option by `zle`
2024-01-26 11:26:14 +11:00
Arjun Reddy K
8dd05bfcc1 Update README.md
Remove percent sign (%). The source command should not be prefixed with % symbol.
2023-11-23 12:12:14 +02:00
Ilkin Bayramli
8f5d8a5aa9
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>
2023-11-21 19:54:14 +02:00
Atte Peltomäki
4f982d65b4 Merge branch 'zinit-readme'
Resolved merge conflict.
2023-11-21 19:45:43 +02:00
Padsworth
a7e6d94ba5 updated readme to include Zinit instructions 2023-11-21 19:24:11 +02:00
Andy Richardson
19b887667a Use brew to determine prefix
https://docs.brew.sh/FAQ#why-should-i-install-homebrew-in-the-default-location
2023-11-08 13:33:12 +02:00
2 changed files with 29 additions and 6 deletions

View file

@ -23,7 +23,15 @@ Install
Using the [Homebrew]( https://brew.sh ) package manager: Using the [Homebrew]( https://brew.sh ) package manager:
brew install zsh-history-substring-search 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 [Fig](https://fig.io):
Fig adds apps, shortcuts, and autocomplete to your existing terminal.
Install `zsh-history-substring-search` in just one click.
<a href="https://fig.io/plugins/other/zsh-history-substring-search" target="_blank"><img src="https://fig.io/badges/install-with-fig.svg" /></a>
Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh): Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh):
@ -63,18 +71,33 @@ bindkey '^[[B' history-substring-search-down # or '\eOB'
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 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 Usage
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
1. Load this script into your interactive ZSH session: 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, 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: then make sure that you load it *before* you load this script:
% source zsh-syntax-highlighting.zsh source zsh-syntax-highlighting.zsh
% source zsh-history-substring-search.zsh source zsh-history-substring-search.zsh
2. Bind keyboard shortcuts to this script's functions. 2. Bind keyboard shortcuts to this script's functions.

View file

@ -406,7 +406,7 @@ _history-substring-search-end() {
# For debugging purposes: # For debugging purposes:
# zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} # 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 # 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 # before removing search highlight and exiting. This ensures no highlights
# are left lingering after search is finished. # 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}*}" ) region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" )
fi fi