Fix GNU core utilities ls aliases, close #31
This commit is contained in:
parent
04c3df512a
commit
cbffacd245
21
alias.zsh
21
alias.zsh
@ -8,14 +8,25 @@
|
|||||||
setopt CORRECT # Correct commands.
|
setopt CORRECT # Correct commands.
|
||||||
|
|
||||||
# The 'ls' Family
|
# The 'ls' Family
|
||||||
if zstyle -t ':omz:alias:ls' color; then
|
if (( $+commands[dircolors] )); then
|
||||||
if [[ -f "$HOME/.dir_colors" ]] && (( $+commands[dircolors] )); then
|
# GNU core utilities.
|
||||||
|
alias ls='ls --group-directories-first'
|
||||||
|
|
||||||
|
if zstyle -t ':omz:alias:ls' color; then
|
||||||
|
if [[ -f "$HOME/.dir_colors" ]]; then
|
||||||
eval $(dircolors "$HOME/.dir_colors")
|
eval $(dircolors "$HOME/.dir_colors")
|
||||||
alias ls='ls -hF --group-directories-first --color=auto'
|
fi
|
||||||
|
alias ls="$aliases[ls] --color=auto"
|
||||||
else
|
else
|
||||||
export CLICOLOR=1
|
alias ls="$aliases[ls] -F"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# BSD core utilities.
|
||||||
|
if zstyle -t ':omz:alias:ls' color; then
|
||||||
export LSCOLORS="exfxcxdxbxegedabagacad"
|
export LSCOLORS="exfxcxdxbxegedabagacad"
|
||||||
alias ls='ls -G -F'
|
alias ls="ls -G"
|
||||||
|
else
|
||||||
|
alias ls='ls -F'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -60,11 +60,15 @@ if (( $+commands[gdircolors] )); then
|
|||||||
}
|
}
|
||||||
|
|
||||||
# A sensible default for ls.
|
# A sensible default for ls.
|
||||||
if zstyle -t ':omz:alias:ls' color && [[ -f "$HOME/.dir_colors" ]]; then
|
alias ls='ls --group-directories-first'
|
||||||
|
|
||||||
|
if zstyle -t ':omz:alias:ls' color; then
|
||||||
|
if [[ -f "$HOME/.dir_colors" ]]; then
|
||||||
eval $(gdircolors "$HOME/.dir_colors")
|
eval $(gdircolors "$HOME/.dir_colors")
|
||||||
alias ls='ls -hF --group-directories-first --color=auto'
|
fi
|
||||||
|
alias ls="$aliases[ls] --color=auto"
|
||||||
else
|
else
|
||||||
alias ls='ls -hF --group-directories-first'
|
alias ls="$aliases[ls] -F"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user