Created
May 18, 2011 15:08
-
-
Save Bregor/978764 to your computer and use it in GitHub Desktop.
Gentoo theme for oh-my-zsh with dollar sign instead of percent in unprivileged user prompt (as in gentoo).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prompt_char { | |
if [ $UID -eq 0 ]; then echo "#"; else echo $; fi | |
} | |
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} ' | |
ZSH_THEME_GIT_PROMPT_PREFIX="(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX=") " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Bregor You can just use %(!.#.$)
see http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html