Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # print the git info for a directory
- __git_branch() {
- if __has_parent_dir ".git"; then
- echo "-[$(git rev-parse --abbrev-ref HEAD)]";
- fi
- }
- # print the directory name
- # some custom logic to shorten certain paths for readability
- __directory_name() {
- directory="$(pwd)"
- echo "$directory";
- }
- # print the host name or whatever you'd like to see there
- # in my case i'm using a short abbreviation as my hostname is long and ugly
- __hostname() {
- echo "pegasus";
- }
- # COLOR SCHEME
- black=$(tput -Txterm setaf 0)
- red=$(tput -Txterm setaf 1)
- green=$(tput -Txterm setaf 2)
- yellow=$(tput -Txterm setaf 3)
- dk_blue=$(tput -Txterm setaf 4)
- pink=$(tput -Txterm setaf 5)
- lt_blue=$(tput -Txterm setaf 6)
- bold=$(tput -Txterm bold)
- reset=$(tput -Txterm sgr0)
- # Nicely formatted terminal prompt
- export PS1='\n\[$bold\]\[$black\][\[$dk_blue\]\@\[$black\]]-[\[$green\]\u\[$yellow\]@\[$green\]$(__hostname) \[$black\]]-[\[$pink\]$(__directory_name) \[$black\]]\[\033[0;33m\]$(__git_branch) \[\033[00m\]\[$reset\]\n\[$reset\]\$ '
- # grep colors
- export GREP_OPTIONS='--color=auto'
- export GREP_COLOR='1;35;40'
Add Comment
Please, Sign In to add comment