oh-my-zsh自定义配置
oh-my-zsh主题配置默认的 一般情况下,我们安装 编辑 local ret_status="%(?:%{$fg_bold[green]%}? :%{$fg_bold[red]%}? )" PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' 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]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 将 如下: local ret_status="%(?:%{$fg_bold[yellow]%}${USER} %{$fg_bold[green]%}? :%{$fg_bold[yellow]%}${USER} %{$fg_bold[red]%}? )" PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' 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]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 这样当使用 if [ `id -u` -eq 0 ];then local ret_status="%(?:%{$fg_bold[yellow]%}root %{$fg_bold[green]%}? :%{$fg_bold[yellow]%}root %{$fg_bold[red]%}? )" else local ret_status="%(?:%{$fg_bold[yellow]%}${USER} %{$fg_bold[green]%}? :%{$fg_bold[yellow]%}${USER} %{$fg_bold[red]%}? )" fi PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' 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]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 保存退出,在终端中执行 样式为" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |