diff --git a/config/aliases.nu b/config/aliases.nu index 6dc92b0..cb752b5 100644 --- a/config/aliases.nu +++ b/config/aliases.nu @@ -34,13 +34,13 @@ def _ls_format_mode [mode: string] { # quick and easy ls def ls [dir?: string] { - let output = _ls (if $dir == null { "" } else { $dir }) | sort-by type name -i + let output = (if $dir == null { _ls } else { _ls $dir }) | sort-by type name -i if ($output | length) == 0 { "" | cat } else { $output | grid -c -s " " | cat } } # ls with hidden files def la [dir?: string] { - _ls -al (if $dir == null { "" } else { $dir }) + (if $dir == null { _ls -al } else { _ls -al $dir }) | sort-by type name -i | each { $in | update mode (_ls_format_mode $in.mode) } | select mode name target user size modified @@ -48,7 +48,7 @@ def la [dir?: string] { # ls with details def ll [dir?: string] { - _ls -l (if $dir == null { "" } else { $dir }) + (if $dir == null { _ls -l } else { _ls -l }) | each { $in | update mode (_ls_format_mode $in.mode) } | sort-by type name -i | select mode name target user size modified diff --git a/env.nu b/env.nu index 8f3d40a..8f4d99f 100644 --- a/env.nu +++ b/env.nu @@ -83,7 +83,7 @@ def create_left_prompt [] { "" } - let sudo_compromised = if not (which sudo | get path.0) == "/usr/bin/sudo" { + let sudo_compromised = if not ((which sudo | get path.0) == "/usr/bin/sudo") { (ansi red_bold) + " ‹sudo compromised›" + (ansi reset) } else { ""