Skip to content

Instantly share code, notes, and snippets.

@dimMaryanto93
Last active April 26, 2023 04:34
Show Gist options
  • Save dimMaryanto93/e7cf8e5fbeddcdf4e2d992f09f920c14 to your computer and use it in GitHub Desktop.
Save dimMaryanto93/e7cf8e5fbeddcdf4e2d992f09f920c14 to your computer and use it in GitHub Desktop.
Oh my zsh theme for mac
# the following to ~/.zshrc:
eval "$(rbenv init - zsh)"
## set java home
# export JAVA_HOME=$(/usr/libexec/java_home -v 1.8.0_351)
# export JAVA_HOME=$(/usr/libexec/java_home -v 11.0.17)
export JAVA_HOME=$(/usr/libexec/java_home -v 19)
# export JAVA_HOME=$(/usr/libexec/java_home -v 11.0.13)
# export JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-lts-java11-20.3.4/Contents/Home
# ZSH Theme emulating the Fish shell's default prompt.
_fishy_collapsed_wd() {
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
echo "💻 ${(j:/:)pwd} "
}
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
PROMPT='%{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.➡ )'
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
RPROMPT="${RPROMPT}"'${return_status}$(git_prompt_status)$(git_prompt_info)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="[📂 "
ZSH_THEME_GIT_PROMPT_SUFFIX="]"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?"
## enable docker plugin
omz plugin enable docker
## enable git plugin
omz plugin enable git
## enable nodejs plugin
omz plugin enable nvm npm
## enable kubernetes plugin
omz plugin enable kubectl minikube
## enable ansible plugin
omz plugin enable ansible
## set theme
wget -O ~/.oh-my-zsh/themes/fishy_dimas.zsh-theme https://gist.githubusercontent.com/dimMaryanto93/e7cf8e5fbeddcdf4e2d992f09f920c14/raw/bfbc192e07ab6cd25d6c329fc4a0d75450ca48ae/fishy_dimas.zsh-theme && \
omz theme set fishy_dimas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment