Created
May 31, 2024 20:12
-
-
Save ibejohn818/9b97bfa5f6688056281b8384d5b5f8c1 to your computer and use it in GitHub Desktop.
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
# vim:ft=zsh ts=2 sw=2 sts=2 | |
rvm_current() { | |
rvm current 2>/dev/null | |
} | |
rbenv_version() { | |
rbenv version 2>/dev/null | awk '{print $1}' | |
} | |
evil_git_untracked_files() { | |
local um=`expr $(git status --porcelain 2>/dev/null| grep "^??" | wc -l)` | |
if [ "$um" != "0" ] | |
then | |
echo "|u:$um|" | |
fi | |
} | |
parse_git_unmerged() { | |
local unmerged=`expr $(git branch --no-color -a --no-merged | wc -l)` | |
if [ "$unmerged" != "0" ] | |
then | |
echo "|u:$unmerged|" | |
fi | |
} | |
parse_git_unpushed() { | |
local unpushed=`expr $( (git branch --no-color -r --contains HEAD; \ | |
git branch --no-color -r) | sort | uniq -u | wc -l )` | |
if [ "$unpushed" != "0" ] | |
then | |
echo "|unpushed:$unpushed" | |
fi | |
} | |
git_tracked() { | |
out="" | |
q=`expr $(git status --porcelain 2>/dev/null|grep "^??"| wc -l)`; | |
if [ "$q" != "0" ] | |
then | |
out="|?:$q" | |
fi | |
a=`expr $(git status --porcelain 2>/dev/null|grep "^A\| A"| wc -l)`; | |
if [ "$a" != "0" ] | |
then | |
out="$out|A:$a" | |
fi | |
m=`expr $(git status --porcelain 2>/dev/null|grep "^M\| M"| wc -l)`; | |
if [ "$m" != "0" ] | |
then | |
out="$out|M:$m" | |
fi | |
d=`expr $(git status --porcelain 2>/dev/null|grep "^D\| D"| wc -l)`; | |
if [ "$d" != "0" ] | |
then | |
out="$out|D:$d" | |
fi | |
if [ "$out" != "" ] | |
then | |
out="$out|" | |
fi | |
echo $out | |
} | |
ssh_conn() { | |
if [ -z "$SSH_CONNECTION" ] | |
then | |
echo "ssh: $(hostname -f)" | |
fi | |
} | |
my_cursor () { | |
local c=→ | |
echo $c | |
} | |
ps1_top_line () { | |
local conda="" | |
local aws_profile="" | |
if [ ! -z "${CONDA_DEFAULT_ENV}" ]; then | |
conda="(conda: ${CONDA_DEFAULT_ENV})" | |
fi | |
if [ ! -z "${AWS_PROFILE}" ]; then | |
aws_profile="(aws profile: ${AWS_PROFILE})" | |
fi | |
echo "${conda} ${aws_profile}" | |
} | |
PROMPT=' | |
$(ps1_top_line) | |
%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} | |
$(git_tracked) → ' | |
# Must use Powerline font, for \uE0A0 to render. | |
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}\uE0A0 " | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
if [ -z "$AWSH_INFO" ] | |
then | |
RPROMPT='$(battery_level_gauge)' | |
else | |
RPROMPT='${AWSH_INFO} $(battery_level_gauge)' | |
fi | |
#if [ -e ~/.rvm/bin/rvm-prompt ]; then | |
#RPROMPT='%{$fg_bold[red]%}‹$(rvm_current)›%{$reset_color%}' | |
#else | |
#if which rbenv &> /dev/null; then | |
#RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}' | |
#fi | |
#fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment