Created
July 6, 2023 23:28
-
-
Save Zidaan-Hayat/606a44124a6a1c80667f8b14e6306aca to your computer and use it in GitHub Desktop.
A minor spin on the "pi" ZSH theme https://github.com/tobyjamesthomas/pi
This file contains 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
PROMPT=' ${return_status} %{$fg[blue]%}$(get_pwd)%{$reset_color%} $(git_prompt_info)${prompt_suffix}' | |
local return_status="%(?:%{$fg_bold[green]%}π:%{$fg_bold[red]%}π)" | |
local prompt_suffix="%{$fg[magenta]%}%{$reset_color%}" | |
# by shashankmehta (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 | |
prompt_short_dir=%~ | |
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[yellow]%}✗" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment