Apple changed shell from bash
to zsh
in its latest OS, so I'm trying to fix my Terminal prompt now :(.
I would like my prompt to only contain:
- current directory I'm in (without the full path)
- NO username and computer name
- current git branch (colored in green)
~
if I'm in the home directory- a
$
and a space at the end
I used to have this script in my .bash_profile
when I was using bash
:
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[33;1m\]\W\[\033[32m\]\$(parse_git_branch)\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
I renamed .bash_profile
into .zprofile
, but all this is not working anymore except for the ls
part.
How do I make this work again?