fish: add shellAbbrs config
Co-authored-by: Sam <30577766+Samasaur1@users.noreply.github.com>
This commit is contained in:
parent
e04a388232
commit
6f24595362
1 changed files with 17 additions and 0 deletions
|
|
@ -8,6 +8,10 @@ let
|
|||
|
||||
cfg = config.programs.fish;
|
||||
|
||||
fishAbbrs = concatStringsSep "\n" (
|
||||
mapAttrsToList (k: v: "abbr -a ${k} -- ${escapeShellArg v}") cfg.shellAbbrs
|
||||
);
|
||||
|
||||
fishAliases = concatStringsSep "\n" (
|
||||
mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}")
|
||||
(filterAttrs (k: v: v != null) cfg.shellAliases)
|
||||
|
|
@ -101,6 +105,18 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
shellAbbrs = mkOption {
|
||||
default = {};
|
||||
example = {
|
||||
gco = "git checkout";
|
||||
npu = "nix-prefetch-url";
|
||||
};
|
||||
description = ''
|
||||
Set of fish abbreviations.
|
||||
'';
|
||||
type = with types; attrsOf str;
|
||||
};
|
||||
|
||||
shellAliases = mkOption {
|
||||
default = config.environment.shellAliases;
|
||||
description = ''
|
||||
|
|
@ -217,6 +233,7 @@ in
|
|||
# if we haven't sourced the interactive config, do it
|
||||
status --is-interactive; and not set -q __fish_nix_darwin_interactive_config_sourced
|
||||
and begin
|
||||
${fishAbbrs}
|
||||
${fishAliases}
|
||||
|
||||
${sourceEnv "interactiveShellInit"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue