Skip to content

Instantly share code, notes, and snippets.

@ihower
Created July 12, 2020 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihower/6acca82032774f0300cdf9126750569c to your computer and use it in GitHub Desktop.
Save ihower/6acca82032774f0300cdf9126750569c to your computer and use it in GitHub Desktop.
# https://support.apple.com/zh-tw/HT208050
export BASH_SILENCE_DEPRECATION_WARNING=1
# https://github.com/mrzool/bash-sensible
source ~/.sensible.bash
export PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:$PATH
export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"
export PATH="/usr/local/opt/node@10/bin:$PATH"
alias s="subl"
alias x="exit"
alias c="clear"
export LC_ALL=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LANG=en-US
export EDITOR="subl"
function parse_git_dirty {
if [[ $(git status 2> /dev/null | tail -n1) == "nothing to commit, working tree clean" ]]; then
echo "✔ "
else
echo "✘ "
fi
}
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("$(parse_git_dirty)${ref#refs/heads/}")";
}
PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\\[\033[0m\]🚀 "
# https://www.iterm2.com/documentation-shell-integration.html
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment