Oh My ZSH! and the alias command
If you spend any real amount of time in the terminal, the single highest-leverage change you can make is to stop typing the same long commands over and over. An alias is a short name that stands in for a longer command, and with Oh My Zsh managing your shell, they take about ten seconds to set up.
Where aliases live
With Oh My Zsh installed, your configuration sits in ~/.zshrc. Open it in your editor of choice and scroll to the bottom - this is where custom aliases feel most at home.
code ~/.zshrc
Writing your first alias
The syntax is simple: alias name="command". No spaces around the equals sign. Here are a few I reach for every day:
alias gs="git status"
alias gc="git commit -m"
alias gp="git push"
alias ll="ls -lah"
alias ..="cd .."
alias reload="source ~/.zshrc"
After saving, either restart your terminal or run reload - which, conveniently, is now an alias for re-sourcing the file.
The ones you already have
Oh My Zsh’s git plugin ships with a pile of these built in - ga for git add, gco for git checkout, glog for the pretty graph log. Run alias | grep git to see the full list; it’s well worth a browse before defining your own.
A tip that pays off
Keep a small block at the bottom of your .zshrc for project-specific shortcuts, and version your dotfiles in a Git repo. When you set up a new machine, everything you’ve trained your fingers to type just comes along with you.
Small change, enormous payoff.