mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 03:09:47 +01:00
zsh: make autosuggest strategy accept more options
Now accepts an empty list, which turns off the code so the user can manually set ZSH_AUTOSUGGEST_STRATEGY anywhere they want via any of the `*Variables` module options.
This commit is contained in:
parent
ad48eb25cd
commit
3a7fc9cd71
1 changed files with 7 additions and 1 deletions
|
@ -427,6 +427,9 @@ in
|
|||
- `match_prev_cmd`: Like `history`, but chooses the most recent match whose preceding history item matches
|
||||
the most recently executed command. 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`.
|
||||
|
||||
Setting the option to an empty list `[]` will make ZSH_AUTOSUGGESTION_STRATEGY not be set automatically,
|
||||
allowing the variable to be declared in {option}`programs.zsh.localVariables` or {option}`programs.zsh.sessionVariables`
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -641,7 +644,10 @@ in
|
|||
|
||||
(optionalString cfg.autosuggestion.enable ''
|
||||
source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
${optionalString (cfg.autosuggestion.strategy != []) ''
|
||||
ZSH_AUTOSUGGEST_STRATEGY=(${concatStringsSep " " cfg.autosuggestion.strategy})
|
||||
''
|
||||
}
|
||||
'')
|
||||
(optionalString (cfg.autosuggestion.enable && cfg.autosuggestion.highlight != null) ''
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="${cfg.autosuggestion.highlight}"
|
||||
|
|
Loading…
Reference in a new issue