diff --git a/.custom/lambda-gitster.zsh-theme b/.custom/lambda-gitster.zsh-theme new file mode 100644 index 0000000..7c2931a --- /dev/null +++ b/.custom/lambda-gitster.zsh-theme @@ -0,0 +1,24 @@ +local ret_status="%(?:%{$fg_bold[green]%}λ :%{$fg_bold[red]%}λ %s)" + +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%}" + diff --git a/.gitignore b/.gitignore index 319df85..975ca1b 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ !wallpapers/** !.oh-my-zsh !.oh-my-zsh/** +!.custom +!.custom/**