From c7d69cd1004541034577185641761d4fbe62f3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 4 Jan 2024 21:35:29 +0100 Subject: [PATCH] Start using lsd Amazing project and commit name --- hm/common.nix | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index 0834dfd..21d5501 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -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;