Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export CLICOLOR=1
- export LSCOLORS=GxFxCxDxBxegedabagaced
- export PROMPT_COMMAND='echo -ne "\033]0;${PWD##*/}\007"'
- #export PS1="\[$(tput setaf 64)\]\h\[$(tput setaf 33)\]@\u\[$(tput setaf 71)\]$ $(tput sgr0)"
- echo "Loding from .bash_profile..!!"
- source ~/scripts/git-completion.bash
- [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
- [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
- function myip() {
- ifconfig lo0 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "lo0 : " $2}'
- ifconfig en0 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "en0 (IPv4): " $2 " " $3 " " $4 " " $5 " " $6}'
- ifconfig en0 | grep 'inet6 ' | sed -e 's/ / /' | awk '{print "en0 (IPv6): " $2 " " $3 " " $4 " " $5 " " $6}'
- ifconfig en1 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "en1 (IPv4): " $2 " " $3 " " $4 " " $5 " " $6}'
- ifconfig en1 | grep 'inet6 ' | sed -e 's/ / /' | awk '{print "en1 (IPv6): " $2 " " $3 " " $4 " " $5 " " $6}'
- }
- # Get the current git branch name (if available)
- git_prompt() {
- local ref=$(git symbolic-ref HEAD 2>/dev/null | cut -d'/' -f3)
- if [ "$ref" != "" ]
- then
- echo "[$ref$(parse_git_dirty)$(parse_git_stash)]"
- fi
- }
- # Returns "*" if the current git branch is dirty.
- function parse_git_dirty {
- [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "*"
- }
- # Returns "|shashed:N" where N is the number of stashed states (if any).
- function parse_git_stash {
- local stash=`expr $(git stash list 2>/dev/null| wc -l)`
- if [ "$stash" != "0" ]
- then
- echo "|stashed:$stash"
- fi
- }
- export MYPS='$(echo -n "${PWD/#$HOME/~}" | awk -F "/" '"'"'{
- if (length($0) > 14) { if (NF>4) print $1 "/" $2 "/.../" $(NF-1) "/" $NF;
- else if (NF>3) print $1 "/" $2 "/.../" $NF;
- else print $1 "/.../" $NF; }
- else print $0;}'"'"')'
- #export PS1='\[$(tput setaf 64)\]\h\[$(tput setaf 33)\]@\u\[$(tput setaf 7)\]$(git_branch)$(tput sgr0)$ $(tput sgr0)'
- export PS1='\[$(tput setaf 64)\]\h\[$(tput setaf 33)\]@\u\[$(tput setaf 64)\][$(eval "echo ${MYPS}")]$(tput setaf 7)\]$(git_prompt)$(tput sgr0)$ $(tput sgr0)'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement