]> arthur.barton.de Git - ax-zsh.git/blob - default_plugins/ls/ls.zshrc
axzshctl: Look harder for themes in remote modules
[ax-zsh.git] / default_plugins / ls / ls.zshrc
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # ls.zshrc: Setup ls(1)
3
4 # Check which ls-alike command to use
5 if (( $+commands[gls] )); then
6         cmd="gls"       # GNU ls (on NetBSD, for example)
7 elif (( $+commands[colorls] )); then
8         cmd="colorls"   # OpenBSD
9 else
10         cmd="ls"
11 fi
12
13 if $cmd --color -d . >/dev/null 2>&1; then
14         alias ls="$cmd -F --color=tty"
15 elif $cmd -G -d . >/dev/null 2>&1; then
16         alias ls="$cmd -FG"
17 fi
18
19 # Use LS_COLORS for completion too, when available
20 if [[ -n "$LS_COLORS" ]]; then
21         zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
22 fi