Skip to content

Instantly share code, notes, and snippets.

@imvasen
Last active August 12, 2024 17:09
Show Gist options
  • Select an option

  • Save imvasen/6bc032c1a002760db74f2845cdc9a5e3 to your computer and use it in GitHub Desktop.

Select an option

Save imvasen/6bc032c1a002760db74f2845cdc9a5e3 to your computer and use it in GitHub Desktop.
My OhMyZsh theme
# Keep these as ref     
local icon=""
if [[ "$OSTYPE" =~ "darwin" ]]; then
icon=" "
elif [ "$OSTYPE" = "linux-gnu" ]; then
icon=" "
else
icon=" "
fi
local ret_status="%B%F{%(?:green:red)}$icon%f%b"
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 %F{yellow}$(virtualenv_prompt_info)%f%F{white}$(get_pwd)%f$(git_prompt_info)$ '
ZSH_THEME_GIT_PROMPT_PREFIX="%F{cyan}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
ZSH_THEME_GIT_PROMPT_DIRTY=" %F{yellow}✗ %f"
ZSH_THEME_GIT_PROMPT_CLEAN=" %F{green}✓ %f"
@imvasen
Copy link
Author

imvasen commented Aug 9, 2024

To properly work, you need a Nerd Font, or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment