history-substring-search: Tweak documentation and cleanup

main
Indrajit Raychaudhuri 1 year ago
parent 74a19fb665
commit 5ac930d96b

@ -63,18 +63,21 @@ _`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh ```sh
zstyle ':prezto:module:history-substring-search' globbing-flags '' zstyle ':prezto:module:history-substring-search' globbing-flags ''
```
### Case sensitive search
To set the search matched against the start of each history entry, add the following line to To set the search case-sensitivity, add the following line to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_: _`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh ```sh
zstyle ':prezto:module:history-substring-search' prefixed 'yes' zstyle ':prezto:module:history-substring-search' case-sensitive 'yes'
``` ```
### Fuzzy search ### Fuzzy search
To enable fuzzy search add the following line to To enable search for fuzzy matches, add the following line to
`${ZDOTDIR:-$HOME}/.zpreztorc`_: _`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh ```sh
zstyle ':prezto:module:history-substring-search' fuzzy 'yes' zstyle ':prezto:module:history-substring-search' fuzzy 'yes'
@ -82,11 +85,20 @@ zstyle ':prezto:module:history-substring-search' fuzzy 'yes'
### Unique results ### Unique results
To retrieve only unique results (remove duplicates) add the following line to To enable unique results, add the following line to
`${ZDOTDIR:-$HOME}/.zpreztorc`_: _`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh ```sh
zstyle ':prezto:module:history-substring-search' ensure-unique 'yes' zstyle ':prezto:module:history-substring-search' unique 'yes'
```
### Prefixed search
To enable prefixed search matches, add the following line to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh
zstyle ':prezto:module:history-substring-search' prefixed 'yes'
``` ```
## Authors ## Authors

@ -34,10 +34,6 @@ if zstyle -t ':prezto:module:history-substring-search' case-sensitive; then
HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS="${HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS//i}" HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS="${HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS//i}"
fi fi
if zstyle -t ':prezto:module:history-substring-search' prefixed; then
HISTORY_SUBSTRING_SEARCH_PREFIXED='true'
fi
if ! zstyle -t ':prezto:module:history-substring-search' color; then if ! zstyle -t ':prezto:module:history-substring-search' color; then
unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND} unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND}
fi fi
@ -46,10 +42,14 @@ if zstyle -t ':prezto:module:history-substring-search' fuzzy; then
HISTORY_SUBSTRING_SEARCH_FUZZY=1 HISTORY_SUBSTRING_SEARCH_FUZZY=1
fi fi
if zstyle -t ':prezto:module:history-substring-search' ensure-unique; then if zstyle -t ':prezto:module:history-substring-search' unique; then
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
fi fi
if zstyle -t ':prezto:module:history-substring-search' prefixed; then
HISTORY_SUBSTRING_SEARCH_PREFIXED=1
fi
# #
# Key Bindings # Key Bindings
# #

@ -109,13 +109,16 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Set the search globbing flags. # Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags '' # zstyle ':prezto:module:history-substring-search' globbing-flags ''
# Enable fuzzy search # Enable search case-sensitivity.
# zstyle ':prezto:module:history-substring-search' case-sensitive 'yes'
# Enable search for fuzzy matches.
# zstyle ':prezto:module:history-substring-search' fuzzy 'yes' # zstyle ':prezto:module:history-substring-search' fuzzy 'yes'
# Retrieve only unique results (removes duplicates) # Enable search uniqueness.
# zstyle ':prezto:module:history-substring-search' ensure-unique 'yes' # zstyle ':prezto:module:history-substring-search' unique 'yes'
# Set the search prefixed. # Enable prefixed search.
# zstyle ':prezto:module:history-substring-search' prefixed 'yes' # zstyle ':prezto:module:history-substring-search' prefixed 'yes'
# #

Loading…
Cancel
Save