# min-percent zsh theme - a minimalist zsh theme with a % or # sign as the prompt terminator # based on pi.zsh-theme (https://github.com/tobyjamesthomas/pi) by Toby Thomas # # Extra space after unicode emoji character (⚠) is needed for most terminal emulators # alacritty, gnome-terminal, vterm based, etc. # Without it the emoji character is rendered partially on the next symbol -- the problem being unicode # emojis being treated as single width character but they are usually double. PROMPT='%{$fg_bold[blue]%}$(get_pwd)%{$reset_color%} $(git_prompt_info)%(?:%{$fg_bold[red]%}%#:%{$fg_bold[red]%}⚠ %#) %{$reset_color%}' # modified function taken from shashankmehta's dot files # (https://github.com/shashankmehta) 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 # full prompt: # prompt_short_dir=%~ # shortened prompt: prompt_short_dir=%(4~|%-1~/…/%2~|%3~) else parent=${git_root%\/*} prompt_short_dir=" ${PWD#$parent/}" fi echo $prompt_short_dir } ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[magenta]%}⛌ " ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}⬥ "