mirror of
https://github.com/nix-community/home-manager
synced 2024-11-01 00:39:45 +01:00
zsh: Add dirHashes option
This commit is contained in:
parent
9fe15dc83b
commit
9e01441c5c
1 changed files with 22 additions and 0 deletions
|
@ -22,6 +22,10 @@ let
|
||||||
mapAttrsToList (k: v: "alias -g ${k}=${lib.escapeShellArg v}") cfg.shellGlobalAliases
|
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;
|
zdotdir = "$HOME/" + cfg.dotDir;
|
||||||
|
|
||||||
bindkeyCommands = {
|
bindkeyCommands = {
|
||||||
|
@ -234,6 +238,21 @@ in
|
||||||
type = types.attrsOf types.str;
|
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 {
|
enableCompletion = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -488,6 +507,9 @@ in
|
||||||
|
|
||||||
# Global Aliases
|
# Global Aliases
|
||||||
${globalAliasesStr}
|
${globalAliasesStr}
|
||||||
|
|
||||||
|
# Named Directory Hashes
|
||||||
|
${dirHashesStr}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue