Last active
August 12, 2024 17:09
-
-
Save imvasen/6bc032c1a002760db74f2845cdc9a5e3 to your computer and use it in GitHub Desktop.
My OhMyZsh theme
This file contains hidden or 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
| # 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" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To properly work, you need a Nerd Font, or similar.