From b897f5fe70450cd20a4118311e7d1e6b2bfa90bf Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Mon, 25 Oct 2021 09:33:35 +0000 Subject: 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. --- nixos/modules/programs/zsh/zsh-autosuggestions.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nixos/modules') diff --git a/nixos/modules/programs/zsh/zsh-autosuggestions.nix b/nixos/modules/programs/zsh/zsh-autosuggestions.nix index a8fcfff95e59..fee324cc7326 100644 --- a/nixos/modules/programs/zsh/zsh-autosuggestions.nix +++ b/nixos/modules/programs/zsh/zsh-autosuggestions.nix @@ -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)} ''; -- cgit 1.4.1