[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:
parent
17b41952ce
commit
0dfce9e8b7
1 changed files with 16 additions and 11 deletions
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue