Skip to content

Instantly share code, notes, and snippets.

@nahuelsotelo
Last active June 8, 2016 10:57
Show Gist options
  • Save nahuelsotelo/5896adbc657f1346c040a6788ec185fd to your computer and use it in GitHub Desktop.
Save nahuelsotelo/5896adbc657f1346c040a6788ec185fd to your computer and use it in GitHub Desktop.
Aliases for zsh
# ##############################
# Git push and pull allways from the current branch.
# ##############################
get_git_branch() {
echo `git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
}
alias gpull='git pull origin `get_git_branch`'
alias gpush='git push origin `get_git_branch`'
# ##############################
# Reload zsh config after change without restart session
# ##############################
alias reload!='. ~/.zshrc'
# ##############################
# Edit hosts
# ##############################
alias hosts="sudo vi /etc/hosts"
# ##############################
# Change files visibility
# ##############################
alias hidden_on="defaults write com.apple.Finder AppleShowAllFiles YES && killall Finder"
alias hidden_off="defaults write com.apple.Finder AppleShowAllFiles NO && killall Finder"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment