Start using lsd

Amazing project and commit name
This commit is contained in:
Geoffrey Frogeye 2024-01-04 21:35:29 +01:00
parent e1c041368b
commit c7d69cd100
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -23,32 +23,7 @@ in
programs =
let
commonRc = lib.strings.concatLines ([
''
# Colored ls
# TODO Doesn't allow completion. Check out lsd instead
_colored_ls() {
${pkgs.coreutils}/bin/ls -lh --color=always $@ | ${pkgs.gawk}/bin/awk '
BEGIN {
FPAT = "([[:space:]]*[^[:space:]]+)";
OFS = "";
}
{
$1 = "\033[36m" $1 "\033[0m";
$2 = "\033[31m" $2 "\033[0m";
$3 = "\033[32m" $3 "\033[0m";
$4 = "\033[32m" $4 "\033[0m";
$5 = "\033[31m" $5 "\033[0m";
$6 = "\033[34m" $6 "\033[0m";
$7 = "\033[34m" $7 "\033[0m";
print
}
'
}
alias ll="_colored_ls"
alias la="_colored_ls -a"
''
] ++ map (d: "mkdir -p ${d}") (builtins.attrValues direnv));
commonRc = lib.strings.concatLines (map (d: "mkdir -p ${d}") (builtins.attrValues direnv));
# TODO Those directory creations should probably done on home-manager activation
commonSessionVariables = {
TIME_STYLE = "+%Y-%m-%d %H:%M:%S";
@ -82,7 +57,9 @@ in
];
commonShellAliases = {
# Completion for existing commands
ls = "ls -h --color=auto";
ls = "lsd";
ll = "lsd -l";
la = "lsd -la";
mkdir = "mkdir -v";
# cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear.
mv = "mv -iv";
@ -179,6 +156,7 @@ in
sessionVariables = commonSessionVariables;
shellAliases = commonShellAliases // config.frogeye.shellAliases;
};
lsd.enable = true;
dircolors = {
enable = true;
enableBashIntegration = true;