summary refs log tree commit diff
path: root/nixos/modules/programs/zsh/zsh-autosuggestions.nix
diff options
context:
space:
mode:
authorIvan Kozik <ivan@ludios.org>2021-10-25 09:33:35 +0000
committerIvan Kozik <ivan@ludios.org>2021-11-19 01:09:44 +0000
commitb897f5fe70450cd20a4118311e7d1e6b2bfa90bf (patch)
treef6c71009d043352f83c6e0d1561bbb86cc6521af /nixos/modules/programs/zsh/zsh-autosuggestions.nix
parent8e18c70837aa01ade3718cd0fd35b649b3a2cf52 (diff)
downloadnixpkgs-b897f5fe70450cd20a4118311e7d1e6b2bfa90bf.tar
nixpkgs-b897f5fe70450cd20a4118311e7d1e6b2bfa90bf.tar.gz
nixpkgs-b897f5fe70450cd20a4118311e7d1e6b2bfa90bf.tar.bz2
nixpkgs-b897f5fe70450cd20a4118311e7d1e6b2bfa90bf.tar.lz
nixpkgs-b897f5fe70450cd20a4118311e7d1e6b2bfa90bf.tar.xz
nixpkgs-b897f5fe70450cd20a4118311e7d1e6b2bfa90bf.tar.zst
nixpkgs-b897f5fe70450cd20a4118311e7d1e6b2bfa90bf.zip
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.
Diffstat (limited to 'nixos/modules/programs/zsh/zsh-autosuggestions.nix')
-rw-r--r--nixos/modules/programs/zsh/zsh-autosuggestions.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/modules/programs/zsh/zsh-autosuggestions.nix b/nixos/modules/programs/zsh/zsh-autosuggestions.nix
index a8fcfff95e5..fee324cc732 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)}
     '';