Add ZSH_AUTOSUGGEST_MATCH_NUM_PREV_CMDS option

With this the number of preceding commands that have to match when using
the `match_prev_cmd` strategy can be set (and can be multiple now).
This commit is contained in:
druckdev 2021-07-15 00:44:49 +02:00
commit 0d07421b42
No known key found for this signature in database
GPG key ID: CA6B3A516FAC2555
4 changed files with 58 additions and 19 deletions

View file

@ -60,7 +60,8 @@ For example, setting `ZSH_AUTOSUGGEST_STRATEGY=(history completion)` will first
#### When `ZSH_AUTOSUGGEST_STRATEGY` contains `match_prev_cmd`:
- `ZSH_AUTOSUGGEST_MATCH_PREV_MAX_CMDS`: The previous command is only looked at of a number of the most recent commands that match the current prefix. This sets the maximum number of commands to consider. Set it to -1 to always use all matches.
- `ZSH_AUTOSUGGEST_MATCH_PREV_MAX_CMDS`: The previous commands are only looked at of a number of the most recent commands that match the current prefix. This sets the maximum number of commands to consider. Set it to -1 to always use all matches.
- `ZSH_AUTOSUGGEST_MATCH_NUM_PREV_CMDS`: Number of previous commands that should match. Setting this to a value below 1 results in the strategy `history` to be simulated (with extra steps).
### Widget Mapping