From a9828a809725344efc2652b2a7e15bcfbd801d36 Mon Sep 17 00:00:00 2001 From: AtomicCoding Date: Mon, 21 May 2018 18:58:51 -0700 Subject: [PATCH] [completion] LS_COLORS independent of utility module Completion module can now be loaded from an arbitrary location. Closes #275 --- modules/completion/README.md | 2 -- modules/completion/init.zsh | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/completion/README.md b/modules/completion/README.md index 6fc0fa9..d8cb6cf 100644 --- a/modules/completion/README.md +++ b/modules/completion/README.md @@ -5,8 +5,6 @@ Enables and configures smart and extensive tab completion. Completions are sourced from [zsh-completions](https://github.com/zsh-users/zsh-completions). -This should be the **LAST** module in the `zmodules` list in your `.zimrc`. - Contributing ------------ diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index cfdb129..5e0d05a 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -59,7 +59,11 @@ zstyle ':completion:*' verbose yes zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' '+r:|?=**' # directories -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +if (( ${+LS_COLORS} )); then + zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +else + zstyle ':completion:*:default' list-colors ${(s.:.)di=1;34:ln=35:so=32:pi=33:ex=31:bd=1;36:cd=1;33:su=30;41:sg=30;46:tw=30;42:ow=30;43} +fi zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories zstyle ':completion:*:*:cd:*:directory-stack' menu yes select zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'expand'