diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index a38150d..cacd8be 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -76,7 +76,9 @@ if zstyle -T ':prezto:module:utility' safe-ops; then fi # ls -if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*(GNU|lsd|uutils) *} ]]; then +_ls_version="$(ls --version 2>&1)" + +if [[ ${(@M)${(f)_ls_version}:#*(GNU|lsd|uutils) *} ]]; then # GNU Core Utilities if zstyle -T ':prezto:module:utility:ls' dirs-first; then @@ -123,10 +125,12 @@ alias lt='ll -tr' # Lists sorted by date, most recent last. alias lc='lt -c' # Lists sorted by date, most recent last, shows change time. alias lu='lt -u' # Lists sorted by date, most recent last, shows access time. -if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*GNU *} ]]; then +if [[ ${(@M)${(f)_ls_version}:#*GNU *} ]]; then alias lx='ll -XB' # Lists sorted by extension (GNU only). fi +unset _ls_version + # Grep if zstyle -t ':prezto:module:utility:grep' color; then export GREP_COLOR=${GREP_COLOR:-'37;45'} # BSD.