Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
- # ... or force ignoredups and ignorespace
- HISTCONTROL=ignoreboth
- shopt -s histappend
- shopt -s checkwinsize
- if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
- . /etc/bash_completion
- fi
- # enable color support of ls and also add handy aliases
- if [ -x /usr/bin/dircolors ]; then
- test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
- 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'
- fi
- c_reset='\[\033[0;32m\]'
- c_user='\[\033[0;37m\]'
- c_path='\[\033[0;36m\]'
- c_git_clean='\[\033[1;32m\]'
- c_git_dirty='\[\033[1;31m\]'
- function git_prompt {
- if ! git rev-parse --git-dir > /dev/null 2>&1; then
- echo -en "\[\033]2;${USER}:${PWD/$HOME/~}\007\]"
- return 0
- fi
- git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
- if git diff --quiet 2>/dev/null >&2; then
- git_color="${c_git_clean}"
- else
- git_color=${c_git_dirty}
- fi
- echo -en "\[\033]2;GIT: $git_branch\007\]"
- echo " [$git_color$git_branch$c_reset]"
- }
- function prompt_func() {
- prompt="[${c_user}\u${c_reset}]${c_path}\w${c_reset}$(git_prompt)\$ "
- PS1="${prompt}"
- }
- PROMPT_COMMAND=prompt_func
Add Comment
Please, Sign In to add comment