zsh-autosuggestions
zsh-autosuggestions copied to clipboard
Match multiple previous commands & more configuration
- Add
ZSH_AUTOSUGGEST_MATCH_PREV_MAX_CMDSconfiguration option: With this the until now hard-coded value of 200 can be configured. - Add
ZSH_AUTOSUGGEST_MATCH_NUM_PREV_CMDSconfiguration option: With this the number of preceding commands that have to match when using thematch_prev_cmdstrategy can be set (and can be multiple now).
Wanted to create the PR already to get some feedback if what I am doing here is wanted. I would look into writing some tests if that is the case.
I also wanted to ask what you think of an additional option that results in the suggestion being the command that has the most matching previous commands as fallback instead of exact. For the case when there is no matching command with the number of matching previous commands, as this could be the case on higher values for ZSH_AUTOSUGGEST_MATCH_NUM_PREV_CMDS.
Oh, and also: What do you think of the names of the two configuration options? I am a bit unsure if those are good names but have no better idea...