]> arthur.barton.de Git - ax-zsh.git/commitdiff
ls: Set up "dircolors" when available
authorAlexander Barton <alex@barton.de>
Sat, 22 Aug 2015 12:49:02 +0000 (14:49 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 22 Aug 2015 12:49:27 +0000 (14:49 +0200)
And use "dircolors" for completion menus, too.

default_plugins/ls/ls.zprofile [new file with mode: 0644]
default_plugins/ls/ls.zshrc

diff --git a/default_plugins/ls/ls.zprofile b/default_plugins/ls/ls.zprofile
new file mode 100644 (file)
index 0000000..897b16a
--- /dev/null
@@ -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
index 8ac3ba081b92dec2de7aa4551a126cc63fd69142..bb7e8698ec797d311a7750c96cc23171ecd28079 100644 (file)
@@ -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