Created
August 23, 2019 10:45
-
-
Save alejandrobernardis/5e06af477d0db94fbb02ee81bcee74b5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| local ret_status="%(?:%{$fg_bold[green]%}>:%{$fg_bold[red]%}>) " | |
| if [[ "$USER" == "root" ]]; then user_mode="%{$fg_bold[red]%}"; else user_mode="%{$fg_bold[black]%}"; fi | |
| function check_git() { | |
| local _status | |
| local cgit=$(printf '\e[38;5;141m') | |
| if git rev-parse --git-dir > /dev/null 2>&1; then | |
| _status=$(git_prompt_status 2> /dev/null) | |
| [[ ! -z "$_status" ]] && _status=" ${_status}" | |
| echo "$(parse_git_dirty) %{$fg_bold[black]%}git:($cgit$(git_current_branch)%{$fg_bold[black]%},$cgit${$(git_prompt_short_sha):-x}%{$fg_bold[black]%})${_status}" \ | |
| "%{$reset_color%}" | |
| else | |
| echo "" | |
| fi | |
| } | |
| PROMPT=' | |
| %{$fg_bold[black]%}[%m] ${user_mode}%{●%G%}%{$reset_color%} %{$fg_bold[black]%}${USER} $(check_git)%{$fg_bold[black]%}› %/ | |
| ${ret_status}%{$reset_color%}' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="\e[38;5;38m%{●%G%}" | |
| ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[black]%}%{●%G%}" | |
| ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}%{▪%G%}" | |
| ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}%{▪%G%}" | |
| ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}%{▪%G%}" | |
| ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[cyan]%}%{▪%G%}" | |
| ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[magenta]%}%{▲%G%}" | |
| ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg_bold[magenta]%}%{▼%G%}" | |
| ZSH_THEME_GIT_PROMPT_STAGED= | |
| ZSH_THEME_GIT_PROMPT_CONFLICTS= | |
| ZSH_THEME_GIT_PROMPT_CHANGED= | |
| ZSH_THEME_GIT_PROMPT_UNTRACKED= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment