Skip to content

Instantly share code, notes, and snippets.

@devonzuegel
Last active August 29, 2015 14:17
Show Gist options
  • Save devonzuegel/6c1f260d5e9ff101e0df to your computer and use it in GitHub Desktop.
Save devonzuegel/6c1f260d5e9ff101e0df to your computer and use it in GitHub Desktop.
My .zshrc aliases
#
# Executes commands at the start of an interactive session.
#
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file
export EDITOR='subl -n -w'
export VISUAL='subl -n -w'
# Flags:
# -G: default colors, different for directories vs. files
# -F: includes a trailing `/` at the end of directory names
# -l: display long format (file types, permissions, number of hard
# links, owner, group, size, last-modified date, and filename)
# -t: sort the list of files by modification time
alias l='ls -GF -lt | awk '\''{
printf("%-4.4s ", $5);
printf("%4s %-3.2d %-5.5s ", $6, $7, $8);
printf("%-7.59s\n", $9);
}'\'' | tail +2' # Remove first line from output (formerly "total")
alias ls='ls -1 '
# Grep (case-insensitive)
alias lg='l | grep -i'
# Reload aliases
alias ra='source ~/.zshrc'
# Edit aliases
alias zshrc='subl ~/.zshrc'
alias ea='subl ~/.zshrc'
alias bashrc='subl ~/.bashrc'
# ssh into Stanford myth & corn machines
alias myth='ssh -Y devonz@myth.stanford.edu'
alias myth30='ssh -Y devonz@myth30.stanford.edu'
alias corn='ssh -Y devonz@corn.stanford.edu'
alias afs='cd ~/../../afs/ir.stanford.edu/users/d/e/devonz'
alias mmv='noglob zmv -W'
# Git commands
alias ga='git add -A'
alias gc='git commit'
alias gac='git add -A && git commit -m '
alias gl='git log'
alias gb='git branch'
alias gch='git checkout'
alias gm='git merge '
alias grep='grep --color'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment