Created
December 29, 2017 10:49
-
-
Save gokusenz/564cb7cfa8cbc1ca14bf3e15277cac4c 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]%}➜ %s)" | |
| #function git_prompt_info() { | |
| # ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
| # echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX$(parse_git_dirty)" | |
| #} | |
| function get_pwd(){ | |
| git_root=$PWD | |
| while [[ $git_root != / && ! -e $git_root/.git ]]; do | |
| git_root=$git_root:h | |
| done | |
| if [[ $git_root = / ]]; then | |
| unset git_root | |
| prompt_short_dir=%~ | |
| else | |
| parent=${git_root%\/*} | |
| prompt_short_dir=${PWD#$parent/} | |
| fi | |
| echo $prompt_short_dir | |
| } | |
| PROMPT='$ret_status %{$fg[white]%}$(get_pwd) $(git_prompt_info)%{$reset_color%}%{$reset_color%} ' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[yellow]%}✗%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✓%{$reset_color%}" | |
| #ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}[git:" | |
| #ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" | |
| #ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}+%{$reset_color%}" | |
| #ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment