Skip to content

Instantly share code, notes, and snippets.

@olegakbarov
Created May 29, 2015 13:31
Show Gist options
  • Save olegakbarov/49369dea946c8fe44b05 to your computer and use it in GitHub Desktop.
Save olegakbarov/49369dea946c8fe44b05 to your computer and use it in GitHub Desktop.
colorz
[[ -s ~/.bashrc ]] && source ~/.bashrc
set_prompts() {
local black=""
local blue=""
local bold=""
local cyan=""
local green=""
local orange=""
local purple=""
local red=""
local reset=""
local white=""
local yellow=""
local hostStyle=""
local userStyle=""
local pre=""
local post=""
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
tput sgr0
bold=$(tput bold)
reset=$(tput sgr0)
black=$(tput setaf 0)
blue=$(tput setaf 33)
cyan=$(tput setaf 37)
green=$(tput setaf 64)
orange=$(tput setaf 166)
purple=$(tput setaf 125)
red=$(tput setaf 124)
white=$(tput setaf 15)
yellow=$(tput setaf 136)
else
bold=""
reset="\e[0m"
black="\e[1;30m"
blue="\e[1;34m"
cyan="\e[1;36m"
green="\e[1;32m"
orange="\e[1;33m"
purple="\e[1;35m"
red="\e[1;31m"
white="\e[1;37m"
yellow="\e[1;33m"
fi
if [[ "$USER" == "root" ]]; then
userStyle="\[$bold$red\]"
else
userStyle="\[$orange\]"
fi
if [[ "$SSH_TTY" ]]; then
hostStyle="\[$bold$red\]"
else
hostStyle="\[$yellow\]"
fi
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM="auto verbose"
GIT_PS1_SHOWCOLORHINTS=1
pre="\[\033]0;\w\007\]"
pre+="\n"
pre+="\[$userStyle\]\u"
pre+="\[$reset$white\]@"
pre+="\[$hostStyle\]\h"
pre+="\[$reset$white\]: "
pre+="\[$green\]\w"
pre+="\[$reset$white\]\[$reset\]"
post="\n"
post+="\[$reset$white\]\$ \[$reset\]"
PROMPT_COMMAND="__git_ps1 '$pre' '$post' ' on %s'"
}
set_prompts
unset set_prompts
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="./node_modules/.bin:$PATH"
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/X11/lib/pkgconfig
export HISTCONTROL=ignoredups:erasedups
export EDITOR=vim
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias zgrep='zgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
which brew &> /dev/null && . $(brew --prefix)/etc/bash_completion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment