主题路径
~/.oh-my-zsh/themes/robbyrussell.zsh-theme
修改
使用下面内容替换, 最好使用#注释掉旧内容
# 彩色变量设置
autoload -U colors && colors
# 状态箭头
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ ) "
# 用户@主机名
PROMPT+='%{$fg_bold[yellow]%}%n@%m%{$reset_color%}:'
# 显示家目录缩写路径
PROMPT+='%{$fg_bold[cyan]%}%~%{$reset_color%}'
# git 分支和Dirty/Clean标识(需 oh-my-zsh 的 git 插件支持)
PROMPT+=' $(git_prompt_info) '
# Git 分支样式
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}%1{✗%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
替换后保存执行
source ~/.zshrc
效果

218



被折叠的 条评论
为什么被折叠?



