diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2020-07-04 11:54:44 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2020-07-04 11:54:44 -0600 |
commit | 59344b5c59b7190ad3b14a2e8e02db8b5559141b (patch) | |
tree | a8e7ede89d3b896967d7d18d071107bd06c77897 /themes/peepcode.zsh-theme | |
parent | a3be2e4084285d7625e63bfe4b951c58143e3c9c (diff) | |
parent | a15f0f0e9ff17c1ca5c6d694d732e72c7c03a62b (diff) | |
download | zsh-59344b5c59b7190ad3b14a2e8e02db8b5559141b.tar.gz zsh-59344b5c59b7190ad3b14a2e8e02db8b5559141b.tar.bz2 zsh-59344b5c59b7190ad3b14a2e8e02db8b5559141b.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'themes/peepcode.zsh-theme')
-rw-r--r-- | themes/peepcode.zsh-theme | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/themes/peepcode.zsh-theme b/themes/peepcode.zsh-theme index b6dfa6870..044534614 100644 --- a/themes/peepcode.zsh-theme +++ b/themes/peepcode.zsh-theme @@ -4,11 +4,11 @@ # git_repo_path() { - git rev-parse --git-dir 2>/dev/null + command git rev-parse --git-dir 2>/dev/null } git_commit_id() { - git rev-parse --short HEAD 2>/dev/null + command git rev-parse --short HEAD 2>/dev/null } git_mode() { @@ -22,23 +22,26 @@ git_mode() { } git_dirty() { - if [[ "$repo_path" != '.' && `git ls-files -m` != "" ]]; then + if [[ "$repo_path" != '.' && -n "$(command git ls-files -m)" ]]; then echo " %{$fg_bold[grey]%}✗%{$reset_color%}" fi } git_prompt() { local cb=$(git_current_branch) - if [ -n "$cb" ]; then + if [[ -n "$cb" ]]; then local repo_path=$(git_repo_path) echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)" fi } -local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" +local smiley='%(?.%F{green}☺%f.%F{red}☹%f)' PROMPT=' -%~ -${smiley} %{$reset_color%}' +${VIRTUAL_ENV:+"($VIRTUAL_ENV) "}%~ +${smiley} ' -RPROMPT='%{$fg[white]%} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}' +RPROMPT='%F{white} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}' + +# Disable automatic virtualenv prompt change +export VIRTUAL_ENV_DISABLE_PROMPT=1 |