Last active
July 22, 2023 09:29
-
-
Save arpitBhalla/39d6a9119e7e9b104f2508d351aaf433 to your computer and use it in GitHub Desktop.
My ZSH personal 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
_get_directory() { | |
local i pwd | |
# pwd=("${(s:/:)PWD/#$HOME/~}") | |
# if (( $#pwd > 1 )); then | |
# for i in {1..$(($#pwd-1))}; do | |
# # if [[ "$pwd[$i]" = .* ]]; then | |
# # pwd[$i]="${${pwd[$i]}[1,2]}" | |
# # else | |
# # pwd[$i]="${${pwd[$i]}[1]}" | |
# # fi | |
# done | |
# fi | |
# pwd=("${(s:/:)PWD/#$HOME\/Desktop/π }") | |
pwd=("${PWD/#$HOME/π }") | |
pwd=("${pwd/π \/Desktop/π₯οΈ }") | |
pwd=("${(s:/:)pwd}") | |
echo "[${(j: π :)pwd}]" | |
} | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[white]%}at %{$fg_bold[cyan]%}git:" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} π§%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} π%{$reset_color%}" | |
_terminal_title(){ | |
local pwd | |
pwd=("${PWD/#$HOME/π }") | |
pwd=("${pwd/π \/Desktop/π₯οΈ}") | |
pwd=("${(s:/:)pwd}") | |
echo "${(j:/:)pwd}" | |
# if (( $#pwd > 1 )); then | |
# for i in {1..$(($#pwd-1))}; do | |
# if (( $#pwd[$i] > 4 )); then | |
# pwd[$i]="${${pwd[$i]}[1,4]}.." | |
# fi | |
# done | |
# echo "${(j:/:)pwd}" | |
# else | |
# animals="πΆπ±ππΉπ°π¦π»πΌπ»π¨π―π¦πΈπ΅ππππππ§π¦π€π£π₯" | |
# echo "${animals:$(( RANDOM % ${#animals} )):1} " | |
# fi | |
} | |
_theme_characters(){ | |
echo "βΉ" | |
# theme_characters="Ξ·ΞκλμνΟΞ£ΟΟΞ₯Ο Ξ¦ΟΟΞ¨ΟΞ©" | |
# theme_characters="πΊπΈπΌπ»" | |
# echo "${theme_characters:$(( RANDOM % ${#theme_characters} )):1}" | |
} | |
set-long-prompt() { | |
echo -en "\e]2;$(_terminal_title)\a" | |
PROMPT='%{$fg_bold[blue]%}π§@π» %{$fg_bold[white]%}in %{$fg_bold[green]%}$(_get_directory) $(git_prompt_info)%{$reset_color%} | |
%{$fg_bold[green]%}%{$FG[208]%}$(_theme_characters)%{$reset_color%} ' | |
} | |
precmd_functions+=(set-long-prompt) | |
set-short-prompt() { | |
if [[ $PROMPT != '%{$fg_bold[green]%}$(_theme_characters)%{$reset_color%} ' ]]; then | |
PROMPT='%{$fg_bold[green]%}$(_theme_characters)%{$reset_color%} ' | |
zle .reset-prompt | |
fi | |
} | |
zle-line-finish() { set-short-prompt } | |
zle -N zle-line-finish | |
trap 'set-short-prompt; return 130' INT |
Author
arpitBhalla
commented
Mar 5, 2022
•
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin
alias ii='yarn'
alias ss='yarn start'
alias dd='yarn dev'
alias bb='yarn build'
alias cde='code .'
export GPG_TTY=$(tty)
if [[ "$PWD" = '/Users/arpit' ]]; then cd ~/Desktop ;fi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment