feat(nu): shell aliases
This commit is contained in:
parent
f00d86d1a1
commit
8224532f2c
3 changed files with 22 additions and 9 deletions
|
@ -8,7 +8,14 @@ in
|
|||
sessionVariables = {
|
||||
LESS = "-R --use-color";
|
||||
LESSHISTFILE = "-";
|
||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
||||
};
|
||||
shellAliases = {
|
||||
# switch between yubikeys for the same GPG key
|
||||
switch_yubikeys = ''gpg-connect-agent "scd serialno" "learn --force" "/bye"'';
|
||||
|
||||
# podman
|
||||
docker = "podman";
|
||||
docker-compose = "podman-compose";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
plugins = "${pkgs.nu_scripts}/share/nu_scripts";
|
||||
|
||||
shellAliases = lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (k: v: "alias ${k} = ${v}") config.home.shellAliases
|
||||
);
|
||||
|
||||
mkCompletions =
|
||||
completions:
|
||||
lib.concatStringsSep "\n" (
|
||||
|
@ -49,6 +58,7 @@ in
|
|||
''
|
||||
source ${plugins}/aliases/git/git-aliases.nu
|
||||
''
|
||||
+ shellAliases
|
||||
+ mkCompletions completions;
|
||||
};
|
||||
|
||||
|
|
|
@ -88,6 +88,9 @@ in
|
|||
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
|
||||
}
|
||||
];
|
||||
sessionVariables = {
|
||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
||||
};
|
||||
shellAliases = {
|
||||
cat = "bat";
|
||||
|
||||
|
@ -101,13 +104,6 @@ in
|
|||
cp = "cp -i";
|
||||
mv = "mv -i";
|
||||
rm = "rm -i";
|
||||
|
||||
# switch between yubikeys for the same GPG key
|
||||
switch_yubikeys = ''gpg-connect-agent "scd serialno" "learn --force" "/bye"'';
|
||||
|
||||
# podman
|
||||
docker = "podman";
|
||||
docker-compose = "podman-compose";
|
||||
};
|
||||
history.path = "${config.xdg.configHome}/zsh/history";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue