Skip to content

Instantly share code, notes, and snippets.

@chrishuan9
Created April 8, 2022 08:10
Show Gist options
  • Save chrishuan9/d5a135fca2ec7340684972944ba0ebe3 to your computer and use it in GitHub Desktop.
Save chrishuan9/d5a135fca2ec7340684972944ba0ebe3 to your computer and use it in GitHub Desktop.
zshrc
# command autocompletion
autoload -U compinit; compinit
# +----+
# | ls |
# +----+
alias ls='ls -G'
alias lsl='ls -l'
alias ll='ls -lahF'
alias lls='ls -lahFtr'
alias la='ls -A'
alias l='ls -CF'
# +------+
# | ping |
# +------+
alias pg='ping 1.1.1.1'
# +-----+
# | Git |
# +-----+
alias gs='git status'
alias ga='git add'
alias gp='git push'
alias gpo='git push origin'
alias gpt='git push --tag'
alias gtd='git tag --delete'
alias gtdr='git tag --delete origin'
alias gr='git branch -r' # display remote branch
alias gplo='git pull origin'
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias gco='git checkout '
alias gl='git log'
alias gr='git remote'
alias grs='git remote show'
alias glo='git log --pretty="oneline"'
alias glol='git log --graph --oneline --decorate'
alias gclean="git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d" # Delete local branch merged with master
alias gblog="git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'" # git log for each branches
alias gsub="git submodule update --remote" # pull submodules
# +-----+
# | gpg |
# +-----+
export GPG_TTY=$(tty)
export PATH="/usr/local/opt/openjdk@8/bin:$PATH"
# +------+
# | java |
# +------+
export JAVA_HOME=`/usr/libexec/java_home -v 8`
# +--------+
# | nodejs |
# +--------+
export PATH="/usr/local/opt/node@14/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/node@14/lib"
export CPPFLAGS="-I/usr/local/opt/node@14/include"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment