summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloƩ Vulquin <code@toast.bunkerlabs.net>2026-01-28 17:30:09 +0100
committerChloƩ Vulquin <code@toast.bunkerlabs.net>2026-01-28 17:30:09 +0100
commit39896370b7e21318c82c25a3d3dd90f1eee8768e (patch)
tree04bd2dd108141f8e94a9e977d4681bc2b9849d4a
parenteditorconfig: org mode wants tab-width=8 (diff)
zsh: add LS_COLORS defaults and use them for completions
-rw-r--r--dot_config/zsh/zprofile9
-rw-r--r--dot_config/zsh/zshrc.style6
2 files changed, 15 insertions, 0 deletions
diff --git a/dot_config/zsh/zprofile b/dot_config/zsh/zprofile
index ca974ac..aa685d3 100644
--- a/dot_config/zsh/zprofile
+++ b/dot_config/zsh/zprofile
@@ -12,6 +12,15 @@ fi
[ -d "${HISTFILE:h}" ] || mkdir -m 0700 "${HISTFILE:h}"
export EDITOR PAGER
+if [[ -z $LS_COLORS ]]; then
+ # directory, executable, file, pipe, socket
+ # blockdev chardev symlink broken-link
+ export -T LS_COLORS ls_colors=(
+ di='1;34' ex='1;32' fi=0 pi=33 so='1;35'
+ bd='1;33' cd='1;33' ln='1;36' or='1;31'
+ )
+fi
+
setopt nullglob
path=(~/bin ~/.local/share/sh ~/.local/*/bin /opt/*/bin {/usr,}{/local,}/{s,}bin)
diff --git a/dot_config/zsh/zshrc.style b/dot_config/zsh/zshrc.style
index 07e4b56..fdb4584 100644
--- a/dot_config/zsh/zshrc.style
+++ b/dot_config/zsh/zshrc.style
@@ -33,6 +33,12 @@ zstyle ':completion:*:man:*' menu yes select
zstyle ':completion:*' special-dirs ..
+if (( ${#ls_colors} )); then
+ zstyle ':completion:*:default' list-colors $ls_colors
+elif [[ -n $LS_COLORS ]]; then
+ zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
+fi
+
# you may want the following in zshrc.local...
# :completion:*:hosts list of hosts