1
0
Fork 0
mirror of synced 2024-11-03 00:18:57 -04:00

[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.
This commit is contained in:
Eric Nielsen 2018-05-24 20:58:31 -05:00
parent 17b41952ce
commit 0dfce9e8b7

View file

@ -17,14 +17,6 @@ if (( terminfo[colors] >= 8 )); then
else 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' 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 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 else
# BSD # BSD
@ -44,9 +36,7 @@ if (( terminfo[colors] >= 8 )); then
(( ! ${+GREP_COLOR} )) && export GREP_COLOR='37;45' #BSD (( ! ${+GREP_COLOR} )) && export GREP_COLOR='37;45' #BSD
(( ! ${+GREP_COLORS} )) && export GREP_COLORS="mt=${GREP_COLOR}" #GNU (( ! ${+GREP_COLORS} )) && export GREP_COLORS="mt=${GREP_COLOR}" #GNU
if [[ ${OSTYPE} == openbsd* ]]; then if [[ ${OSTYPE} == openbsd* ]]; then
if (( ${+commands[ggrep]} )); then (( ${+commands[ggrep]} )) && alias grep='ggrep --color=auto'
alias grep='ggrep --color=auto'
fi
else else
alias grep='grep --color=auto' alias grep='grep --color=auto'
fi fi
@ -64,6 +54,21 @@ if (( terminfo[colors] >= 8 )); then
fi 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 # ls Aliases
# #