cd ~/.oh-my-zsh/themes/
wget https://gist.github.com/bitqiu/d53b2a0aeb069d121534/raw/100fa99858f5b0970e0e7a0b726b68da90a72403/bitqiu.zsh-theme
vi ~/.zshrc
ZSH_THEME="bitqiu"
| # Directory info. | |
| local current_dir='${PWD/#$HOME/~}' | |
| # Git info. | |
| local git_info='$(git_prompt_info)' | |
| local git_last_commit='$(git_last_commit_cm)' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}on git:%{$fg[cyan]%}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗" | |
| ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔︎" | |
| # git last commit | |
| git_last_commit_cm() { | |
| if [ -n "$(git log --pretty=format:"%h \"%s\"" -1 2> /dev/null)" ]; then | |
| echo -e | |
| echo -n $(git log --pretty=format:"%h \"%s\"" -1 2> /dev/null) | |
| fi | |
| } | |
| local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" | |
| PROMPT="%{$fg[cyan]%}%n%{$reset_color%} in \ | |
| %{$terminfo[bold]$fg[yellow]%}[${current_dir}]%{$reset_color%} \ | |
| ${git_info} \ | |
| ${git_last_commit} | |
| ${ret_status} %{$reset_color%}" |