Files
This could go into .bashrc, .bash_profile or .zshrc - your respective shell config file.
Args
Some aliases for easier handling
1
2
3
4
| # alias shortcuts
alias lla="ls -la"
alias ll="ls -l"
alias l="ls"
|
Then we need a function which parses the current git branch (git has to be installed)…
1
2
3
4
5
| # Git branch in prompt.
parse_git_branch()
{
git branch 2> /dev/null |sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
|
…and input the branch unto your PS1 (current theme) like so:
1
| export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
|
Then I added some more styling for OSX as well as for ls
1
2
3
| export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=gaCxcxdxbxegedabagacad
|
Misc
And some honorable mentions for OSX as well would be:Add MAMP PHP to your path
1
2
3
4
| PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
# export PATH="/usr/local/bin:$PATH"
|
And add the current locale like German, UTF-8 as well
1
| export LC_ALL=de_DE.UTF-8
|