From 0dfce9e8b739ebc7d14a5450020668cc3357e187 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Thu, 24 May 2018 20:58:31 -0500 Subject: [PATCH] [utility] Some GNU aliases are not colours-related and they were mistakenly inside the Colours scope. Move them out of there. Still using the same `(( ${+commands[dircolors]} ))` test because it works well with MacOS with coreutils installed without the `g` prefix, for example. --- modules/utility/init.zsh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index f9877d0..5ba4600 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -17,14 +17,6 @@ if (( terminfo[colors] >= 8 )); then else export LS_COLORS='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 - - alias ls='ls --group-directories-first --color=auto' - alias lx='ll -X' # long format, sort by extension (GNU only) - - # Always wear a condom (GNU only) - alias chmod='chmod --preserve-root -v' - alias chown='chown --preserve-root -v' - else # BSD @@ -44,9 +36,7 @@ if (( terminfo[colors] >= 8 )); then (( ! ${+GREP_COLOR} )) && export GREP_COLOR='37;45' #BSD (( ! ${+GREP_COLORS} )) && export GREP_COLORS="mt=${GREP_COLOR}" #GNU if [[ ${OSTYPE} == openbsd* ]]; then - if (( ${+commands[ggrep]} )); then - alias grep='ggrep --color=auto' - fi + (( ${+commands[ggrep]} )) && alias grep='ggrep --color=auto' else alias grep='grep --color=auto' fi @@ -64,6 +54,21 @@ if (( terminfo[colors] >= 8 )); then fi +# +# GNU only +# + +if (( ${+commands[dircolors]} )); then + + alias ls='ls --group-directories-first --color=auto' + alias lx='ll -X' # long format, sort by extension + + # Always wear a condom + alias chmod='chmod --preserve-root -v' + alias chown='chown --preserve-root -v' +fi + + # # ls Aliases #