config(zsh): add zsh-history-substring-search

main
sudo pacman -Syu 2024-10-09 14:05:30 +07:00
parent 24fbd413a8
commit 6e183ad83e
1 changed files with 12 additions and 1 deletions

View File

@ -22,11 +22,22 @@ export LESS="-RF -i -K -s -x2 --wordwrap"
if [[ -f /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]]; then
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# https://github.com/zsh-users/zsh-autosuggestions#suggestion-strategy
typeset -g ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
typeset -g ZSH_AUTOSUGGEST_HISTORY_IGNORE=$HISTORY_IGNORE
fi
# https://unix.stackexchange.com/q/621606
# https://github.com/zsh-users/zsh-history-substring-search
if [[ -f /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh ]]; then
source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND=''
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND=''
fi
# git
# https://stackoverflow.com/a/43747486
export GIT_COMPLETION_CHECKOUT_NO_GUESS=1