Skip to content

Instantly share code, notes, and snippets.

@devlato
Last active April 13, 2023 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devlato/19c8476858aebc2b55cd33ff733c626d to your computer and use it in GitHub Desktop.
Save devlato/19c8476858aebc2b55cd33ff733c626d to your computer and use it in GitHub Desktop.
A custom, much more fast a responsive gentoo theme for `oh-my-zsh`
# Add this file to ~/.oh-my-zsh/themes/gentoo-custom.zsh-theme
# Then, in your ~/.zshrc, set ZSH_THEME to "gentoo-custom" like this:
# ZSH_THEME=gentoo-custom
function prompt_char {
if [ $UID -eq 0 ]; then echo "#"; else echo $; fi
}
git_branch() {
local branch=$(git rev-parse --abbrev-ref HEAD 2>&1)
if [[ $branch == *fatal* ]]; then
echo '';
else
echo " (${branch})"
fi
}
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~)$(git_branch) $(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