Skip to content

Commit

Permalink
fix: color issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Feb 17, 2019
1 parent 3fdca51 commit b77335b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
15 changes: 8 additions & 7 deletions 1bash.d/0_colors.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/bin/bash

if [ -f ~/.dircolors ]; then
Expand All @@ -7,10 +6,12 @@ elif [ -f $ONE_BASH/dircolors ]; then
eval "$( dircolors -b $ONE_BASH/dircolors )"
fi

if ls --color=auto > /dev/null 2>&1; then colorflag="--color=auto"; else colorflag="-G"; fi;

# enable color support of ls and also add handy aliases
# alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ls='ls $colorflag'
alias dir='dir $colorflag'
alias vdir='vdir $colorflag'
alias grep='grep $colorflag'
alias fgrep='fgrep $colorflag'
alias egrep='egrep $colorflag'
9 changes: 2 additions & 7 deletions 1bash.d/aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,16 @@ alias where=which # sometimes i forget

# ls make colerfull in color.sh
# always use color, even when piping (to awk,grep,etc)
# if ls --color=auto > /dev/null 2>&1; then colorflag="--color=auto"; else colorflag="-G"; fi;
# export CLICOLOR_FORCE=1

# ls options: A = include hidden (but not . or ..), F = put `/` after folders, h = byte unit suffixes
alias lsa="ls -lAhF --color=auto --group-directories-first"
alias lsd="ls --color=auto | grep '^d'" # only directories
alias lsa="ls -lAhF --group-directories-first"
alias lsd="ls | grep '^d'" # only directories
# `la` defined in .functions
###


# `cat` with beautiful colors. requires: sudo easy_install -U Pygments
#alias c="pygmentize -O style=monokai -f console256 -g"

###

# Networking. IP address, dig, DNS
# alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
# alias dig="dig +nocmd any +multiline +noall +answer"
Expand Down

0 comments on commit b77335b

Please sign in to comment.