ZSH

ZSH + Oh My ZSH is an open-source framework to make your shell experience better.

Install

Follow the Oh My ZSH installation instructions.

Shell profile

# Edit your ZSH profile
nano ~/.zshrc

# Apply the profile after editing (or quit and restart your shell)
source ~/.zshrc

Customizations

Add this to the end of your shell profile:

# -----------------------------------------------
# GravDept:
# Add custom paths.
# -----------------------------------------------

# For Composer
export PATH="$HOME/.composer/vendor/bin:$PATH"

# For Watsco "mgc"
export PATH="$HOME/work/clients/baker/repo:$PATH"


# -----------------------------------------------
# GravDept:
# Switch PHP version
# -----------------------------------------------

# Use Mac's PHP (default)

# Use Homebrew php@5.6
#export PATH="/usr/local/opt/php@5.6/bin:$PATH"
#export PATH="/usr/local/opt/php@5.6/sbin:$PATH"

# Use Homebrew php@7.1
#export PATH="/usr/local/opt/php@7.1/bin:$PATH"
#export PATH="/usr/local/opt/php@7.1/sbin:$PATH"

# Use MAMP
#export PATH="/Applications/MAMP/bin/php/php5.6.37/bin:$PATH"


# -----------------------------------------------
# GravDept:
# Custom aliases.
# -----------------------------------------------

# Update shell profile
alias zedit="nano ~/.zshrc"
alias zsource="source ~/.zshrc"

alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../..'

# Listing files and folders
alias ll="ls -l"
alias la="ls -la"
alias lsd='ls -l | grep "^d"'

# Change project
alias cd_{projectName}="cd ~/work/projects/{project}/repo"
alias cd_repos="cd ~/work/repos"
alias cd_valet="cd ~/work/valet"

# For n98-magerun
alias magerun="n98-magerun.phar"

# For Watsco "mgc"
alias mgc_up="mgc src upload app/design/frontend/Baker/base"
alias mgc_updd="mgc src upload pub/design"
alias mgc_hinton="mgc magento dev:template-hints:enable"
alias mgc_hintoff="mgc magento dev:template-hints:disable"


# -----------------------------------------------
# GravDept:
# Required for "nvm".
# -----------------------------------------------

export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh