You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,8 +53,8 @@ For more info, read the Character Highlighting section of the zsh manual: `man z
53
53
`ZSH_AUTOSUGGEST_STRATEGY` is an array that specifies how suggestions should be generated. The strategies in the array are tried successively until a suggestion is found. There are currently three built-in strategies to choose from:
54
54
55
55
-`history`: Chooses the most recent match from history.
56
+
-`completion`: Chooses a suggestion based on what tab-completion would suggest. (requires `zpty` module)
56
57
-`match_prev_cmd`: Like `history`, but chooses the most recent match whose preceding history item matches the most recently executed command ([more info](src/strategies/match_prev_cmd.zsh)). Note that this strategy won't work as expected with ZSH options that don't preserve the history order such as `HIST_IGNORE_ALL_DUPS` or `HIST_EXPIRE_DUPS_FIRST`.
57
-
-`completion`: (experimental) Chooses a suggestion based on what tab-completion would suggest. (requires `zpty` module)
58
58
59
59
For example, setting `ZSH_AUTOSUGGEST_STRATEGY=(history completion)` will first try to find a suggestion from your history, but, if it can't find a match, will find a suggestion from the completion engine.
60
60
@@ -87,6 +87,18 @@ As of `v0.4.0`, suggestions can be fetched asynchronously. To enable this behavi
87
87
88
88
Set `ZSH_AUTOSUGGEST_MANUAL_REBIND` (it can be set to anything) to disable automatic widget re-binding on each precmd. This can be a big boost to performance, but you'll need to handle re-binding yourself if any of the widget lists change or if you or another plugin wrap any of the autosuggest widgets. To re-bind widgets, run `_zsh_autosuggest_bind_widgets`.
89
89
90
+
### Ignoring history suggestions that match a pattern
91
+
92
+
Set `ZSH_AUTOSUGGEST_HISTORY_IGNORE` to a glob pattern to prevent offering suggestions for history entries that match the pattern. For example, set it to `"cd *"` to never suggest any `cd` commands from history. Or set to `"?(#c50,)"` to never suggest anything 50 characters or longer.
93
+
94
+
**Note:** This only affects the `history` and `match_prev_cmd` suggestion strategies.
95
+
96
+
### Skipping completion suggestions for certain cases
97
+
98
+
Set `ZSH_AUTOSUGGEST_COMPLETION_IGNORE` to a glob pattern to prevent offering completion suggestions when the buffer matches that pattern. For example, set it to `"git *"` to disable completion suggestions for git subcommands.
99
+
100
+
**Note:** This only affects the `completion` suggestion strategy.
0 commit comments