Created
November 7, 2018 07:52
-
-
Save CreatiCoding/72def250c884437306d1b3afcf8eab64 to your computer and use it in GitHub Desktop.
ubuntu bash color mode with git branch
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
| # 생략 | |
| # ~ | |
| # enable color support of ls and also add handy aliases | |
| if [ -x /usr/bin/dircolors ]; then | |
| test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
| alias ls='ls --color=auto' | |
| #alias dir='dir --color=auto' | |
| #alias vdir='vdir --color=auto' | |
| alias grep='grep --color=auto' | |
| alias fgrep='fgrep --color=auto' | |
| alias egrep='egrep --color=auto' | |
| fi | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| } | |
| export PS1="\[\e]0;\u@\h \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \[\033[01;32m\]$\[\033[00m\] " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment