diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 362daa3c0..efe2946c4 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -22,6 +22,10 @@ let mapAttrsToList (k: v: "alias -g ${k}=${lib.escapeShellArg v}") cfg.shellGlobalAliases ); + dirHashesStr = concatStringsSep "\n" ( + mapAttrsToList (k: v: ''hash -d ${k}="${v}"'') cfg.dirHashes + ); + zdotdir = "$HOME/" + cfg.dotDir; bindkeyCommands = { @@ -234,6 +238,21 @@ in type = types.attrsOf types.str; }; + dirHashes = mkOption { + default = {}; + example = literalExample '' + { + docs = "$HOME/Documents"; + vids = "$HOME/Videos"; + dl = "$HOME/Downloads"; + } + ''; + description = '' + An attribute set that adds to named directory hash table. + ''; + type = types.attrsOf types.str; + }; + enableCompletion = mkOption { default = true; description = '' @@ -488,6 +507,9 @@ in # Global Aliases ${globalAliasesStr} + + # Named Directory Hashes + ${dirHashesStr} ''; }