From: Alexander Barton Date: Sat, 22 Aug 2015 12:49:02 +0000 (+0200) Subject: ls: Set up "dircolors" when available X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-zsh.git;a=commitdiff_plain;h=ec5c70de1c8848e631a7bc4b071b44077ba48b5e;ds=sidebyside ls: Set up "dircolors" when available And use "dircolors" for completion menus, too. --- diff --git a/default_plugins/ls/ls.zprofile b/default_plugins/ls/ls.zprofile new file mode 100644 index 0000000..897b16a --- /dev/null +++ b/default_plugins/ls/ls.zprofile @@ -0,0 +1,7 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# ls.zshrc: Setup ls(1) + +# Is dircolors(1) available? +if (( $+commands[dircolors] )); then + eval $(dircolors) +fi diff --git a/default_plugins/ls/ls.zshrc b/default_plugins/ls/ls.zshrc index 8ac3ba0..bb7e869 100644 --- a/default_plugins/ls/ls.zshrc +++ b/default_plugins/ls/ls.zshrc @@ -18,3 +18,8 @@ if $cmd -G -d . >/dev/null 2>&1; then alias ls="$cmd -FG" return 0 fi + +# Use LS_COLORS for completion too, when available +if [[ -n "$LS_COLORS" ]]; then + zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +fi