Created
August 31, 2018 00:29
-
-
Save felixrieseberg/f5591839c7962d1f9886a15eba615207 to your computer and use it in GitHub Desktop.
emoji.zsh-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
local ret_status="%(?:%{$fg_bold[green]%}โ :%{$fg_bold[red]%}โ %s)" | |
EMOJI=(๐ฉ ๐ฆ ๐ ๐ ๐จ ๐ ๐ญ ๐ฝ โ๏ธ ๐ฌ ๐ ๐ท ๐ผ ๐ถ ๐ธ ๐ง ๐ณ ๐ ๐ฃ ๐ป ๐ฎ ๐ฐ ๐ ๐พ ๐ ๐ช ๐ ๐ ๐ ๐ ๐ ) | |
function random_emoji { | |
echo -n "$EMOJI[$RANDOM%$#EMOJI+1]" | |
} | |
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='$(random_emoji) $ret_status %{$fg[white]%}$(get_pwd) $(git_prompt_info)%{$reset_color%}%{$reset_color%} ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment