Created
July 17, 2017 12:24
-
-
Save svenliebig/82a02bb0caaa49952336b5da749284ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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() { | |
echo -n ' => (' && git branch 2>/dev/null | grep '^*' | colrm 1 2 | tr -d '\n' && echo -n ')]' | |
} | |
git_project_name() { | |
echo -n '[' && git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p' | tr -d '\n' | |
} | |
git_string() { | |
echo -n '' && git_project_name && git_branch | |
} | |
git_string_cutted() { | |
git_string | sed 's/\[ => ()]//' | |
} | |
export PS1="\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\] \033[0;31m \$(git_string_cutted) \033[0m \n\$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment