Skip to content

Instantly share code, notes, and snippets.

@guness
Last active March 26, 2024 07:30
Show Gist options
  • Save guness/f4df55c9ef16ce05105329637083ceb2 to your computer and use it in GitHub Desktop.
Save guness/f4df55c9ef16ce05105329637083ceb2 to your computer and use it in GitHub Desktop.
Global /etc/zprofile for user based dynamic ANDROID_HOME path.
# System-wide profile for interactive zsh(1) login shells.
# Setup user specific overrides for this in ~/.zprofile. See zshbuiltins(1)
# and zshoptions(1) for more details.
if [ -x /usr/libexec/path_helper ]; then
paths=`/usr/libexec/path_helper -s`
eval ${paths//'\$USER'/$'$USER'}
fi
alias j11="export JAVA_HOME=`/usr/libexec/java_home -v 11`; java -version"
alias j8="export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home'; java -version"
alias ja="export JAVA_HOME='/Applications/Android Studio.app/Contents/jbr/Contents/Home'; java -version"
alias lg="lazygit"
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export ANDROID_SDK_ROOT=/Users/$USER/Library/Android/sdk
#export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export JAVA_HOME='/Applications/Android Studio.app/Contents/jbr/Contents/Home'
# Source for below: https://github.com/mattjj/my-oh-my-zsh/blob/master/history.zsh
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
# setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
setopt HIST_VERIFY # Don't execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing nonexistent history.
export LANG=en_US.UTF-8 # CocaPods needs this
export LC_ALL=en_US.UTF-8 # CocaPods needs this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment