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 and apply changes

# Edit your ZSH profile
# Note: I aliased this to "zedit"
nano ~/.zshrc

Changes won’t apply until you source or restart your shell.

# Source your ZSH profile
# Note: I aliased this to "zsource"
source ~/.zshrc

Customizations

Add this to the end of your shell profile:

# -----------------------------------------------
# GravDept:
# Customize the PATH.
# -----------------------------------------------

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

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

# For Homebrew
export PATH="/usr/local/sbin:$PATH"

# Force MySQL 5.7 as the "mysql" version
export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"


# -----------------------------------------------
# GravDept:
# For A2X Accounting
# -----------------------------------------------

# For Apache Maven
export PATH="/usr/local/bin/apache-maven-3.5.4/bin:$PATH"

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/usr/local/bin/google-cloud-sdk/path.zsh.inc' ]; then source '/usr/local/bin/google-cloud-sdk/path.zsh.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '/usr/local/bin/google-cloud-sdk/completion.zsh.inc' ]; then source '/usr/local/bin/google-cloud-sdk/completion.zsh.inc'; fi


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

# 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_reposgd="cd ~/work/repos-gravitydepartment"
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