ohmyzsh/themes/hanwentao.zsh-theme
Wentao Han 3087fc8d7d Improve my prompt theme
* Display username@hostname when ssh
* Change git style, using ASCII characters
* Combine status code with the prompt character
2014-05-14 14:23:13 +08:00

15 lines
518 B
Bash

function ssh_username_hostname() {
if [[ -n "$SSH_CONNECTION" ]]; then
echo "%{$fg_bold[green]%}%n@%m "
fi
}
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=" "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[yellow]%}X%{$fg[cyan]%})"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})"
local current_dir="%{$fg[blue]%}%~ "
local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%}%? )%# "
PROMPT='$(ssh_username_hostname)${current_dir}$(git_prompt_info)${ret_status}%{$reset_color%}'