Last active
May 13, 2021 11:28
-
-
Save bmabir17/047ee1218fe28f08348ee25092cddc5e to your computer and use it in GitHub Desktop.
Shorten bash path and add time, git_branch info with reference from https://superuser.com/a/1209333/1341976
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} | |
HOST='\[\033[02;36m\]\h'; HOST=' '$HOST | |
TIME='\[\033[01;31m\]\t \[\033[01;32m\]' | |
LOCATION=' \[\033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).$' | |
BRANCH=' \[\033[00;33m\]$(git_branch)\[\033[00m\] ' | |
PS1=$TIME$BRANCH$USER$HOST$LOCATION |
Author
bmabir17
commented
May 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment