Created
December 19, 2019 10:42
-
-
Save genyrosk/0f0f847a04666c02165fe74a5d0c795f to your computer and use it in GitHub Desktop.
A simple and useful prompt for bash
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
# add this to ~/.bashrc or ~/.bash_profile | |
# | |
# A simple and useful prompt for bash | |
# when zsh is not an option. | |
# | |
# - displays current directory | |
# - shows local git branch | |
# - prompt on new line | |
# - skips to new line after each command | |
# | |
# /-------------------------------/ | |
# | ~/dev/project git@(master) | | |
# | $ ls | | |
# | test.py | | |
# | | | |
# | ~/dev/project git@(master) | | |
# | $ | | |
# | | | |
# /-------------------------------/ | |
# | |
export PS1="\n \\w git@(\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)) \n $ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment