Skip to content

Commit

Permalink
feat(history-substring-search): add prefixed setting
Browse files Browse the repository at this point in the history
support zsh-history-substring-search `HISTORY_SUBSTRING_SEARCH_PREFIXED` env

Signed-off-by: mritd <mritd@linux.com>
  • Loading branch information
mritd authored and indrajitr committed Sep 12, 2023
1 parent bd180ee commit 9bf1ae6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/history-substring-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ _`${ZDOTDIR:-$HOME}/.zpreztorc`_:

```sh
zstyle ':prezto:module:history-substring-search' globbing-flags ''

To set the search matched against the start of each history entry, add the following line to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_:

```sh
zstyle ':prezto:module:history-substring-search' prefixed 'yes'
```

### Fuzzy search
Expand Down
4 changes: 4 additions & 0 deletions modules/history-substring-search/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ if zstyle -t ':prezto:module:history-substring-search' case-sensitive; then
HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS="${HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS//i}"
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
unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND}
fi
Expand Down

0 comments on commit 9bf1ae6

Please # to comment.