From d961e63c83c78e2568aa6074491a580d0fb41f06 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 13 Dec 2023 10:27:57 +0100 Subject: [PATCH] l for _ls --- nushell/config/aliases.nu | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nushell/config/aliases.nu b/nushell/config/aliases.nu index 7432231..879160c 100644 --- a/nushell/config/aliases.nu +++ b/nushell/config/aliases.nu @@ -15,6 +15,9 @@ def rm-ext [] { # ls builtin alias _ls = ls +# shortcut for ls builtin +alias l = _ls + def _ls_format_mode [mode: string] { let chars = $mode | split chars let r1 = if ($chars | get 0) == "r" { [(ansi yellow_bold), "r", (ansi reset)] } else { [(ansi grey), "-"] } @@ -29,12 +32,6 @@ def _ls_format_mode [mode: string] { [$r1, $w1, $x1, $r2, $w2, $x2, $r3, $w3, $x3] | each { $in | str join } | str join } -# quick and easy ls -def l [dir?: string] { - let output = _ls (if $dir == null { "" } else { $dir }) | sort-by type name -i - if ($output | length) == 0 { "" | cat } else { $output | grid -c -s " " | cat } -} - # quick and easy ls def ls [dir?: string] { let output = _ls (if $dir == null { "" } else { $dir }) | sort-by type name -i