nixos/autosuggestions: add config to control whether suggestions are async

zsh-autosuggestions now defaults to asynchronous suggestions, but they can
be annoying when they take several frames longer to show up after typing.
This commit is contained in:
Ivan Kozik
2021-11-19 01:09:44 +00:00
parent 8e18c70837
commit b897f5fe70
@@ -36,6 +36,13 @@ in
'';
};
async = mkOption {
type = types.bool;
default = true;
description = "Whether to fetch suggestions asynchronously";
example = false;
};
extraConfig = mkOption {
type = with types; attrsOf str;
default = {};
@@ -56,6 +63,7 @@ in
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="${cfg.highlightStyle}"
export ZSH_AUTOSUGGEST_STRATEGY=("${cfg.strategy}")
${optionalString (!cfg.async) "unset ZSH_AUTOSUGGEST_USE_ASYNC"}
${concatStringsSep "\n" (mapAttrsToList (key: value: ''export ${key}="${value}"'') cfg.extraConfig)}
'';