mirror of
https://github.com/dcarrillo/prezto.git
synced 2026-04-19 13:24:06 +00:00
utility: Avoid multiple ls --version calls per shell startup
This commit is contained in:
@@ -76,7 +76,9 @@ if zstyle -T ':prezto:module:utility' safe-ops; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ls
|
# 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
|
# GNU Core Utilities
|
||||||
|
|
||||||
if zstyle -T ':prezto:module:utility:ls' dirs-first; then
|
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 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.
|
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).
|
alias lx='ll -XB' # Lists sorted by extension (GNU only).
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset _ls_version
|
||||||
|
|
||||||
# Grep
|
# Grep
|
||||||
if zstyle -t ':prezto:module:utility:grep' color; then
|
if zstyle -t ':prezto:module:utility:grep' color; then
|
||||||
export GREP_COLOR=${GREP_COLOR:-'37;45'} # BSD.
|
export GREP_COLOR=${GREP_COLOR:-'37;45'} # BSD.
|
||||||
|
|||||||
Reference in New Issue
Block a user