├── README.md ├── demo.gif └── lambda-gitster.zsh-theme /README.md: -------------------------------------------------------------------------------- 1 |

lambda-gitster

2 | 3 |

4 | 5 | ### How to install 6 | * Clone project `git clone https://github.com/ergenekonyigit/lambda-gitster.git` 7 | * Go to directory `cd lambda-gitster` 8 | * Copy this line and run on terminal `cp lambda-gitster.zsh-theme ~/.oh-my-zsh/custom/themes` 9 | * Set theme name in `.zshrc` `ZSH_THEME="lambda-gitster"` 10 | * Restart terminal and happy processing 11 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ergenekonyigit/lambda-gitster/bc9cb4948920d9cbb72c3b78d18070d1cc94934b/demo.gif -------------------------------------------------------------------------------- /lambda-gitster.zsh-theme: -------------------------------------------------------------------------------- 1 | local ret_status="%(?:%{$fg_bold[green]%}λ :%{$fg_bold[red]%}λ %s)" 2 | 3 | function get_pwd(){ 4 | git_root=$PWD 5 | while [[ $git_root != / && ! -e $git_root/.git ]]; do 6 | git_root=$git_root:h 7 | done 8 | if [[ $git_root = / ]]; then 9 | unset git_root 10 | prompt_short_dir=%~ 11 | else 12 | parent=${git_root%\/*} 13 | prompt_short_dir=${PWD#$parent/} 14 | fi 15 | echo $prompt_short_dir 16 | } 17 | 18 | PROMPT='$ret_status %{$fg[white]%}$(get_pwd) $(git_prompt_info)%{$reset_color%}%{$reset_color%} ' 19 | 20 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}" 21 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 22 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[yellow]%}✗%{$reset_color%}" 23 | ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✓%{$reset_color%}" 24 | 25 | --------------------------------------------------------------------------------