Created
July 31, 2017 22:44
-
-
Save twizmwazin/f4f6a0d1e6eaef5449849370538c1117 to your computer and use it in GitHub Desktop.
Gitster ZSH theme. Mirror of https://github.com/shashankmehta/dotfiles/blob/master/thesetup/zsh/.oh-my-zsh/custom/themes/gitster.zsh-theme
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