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:

# -----------------------------------------------
# For NVM (Node version manager)
# -----------------------------------------------

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion


# -----------------------------------------------
# Customize the PATH
# -----------------------------------------------

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

# DEPRECATED (2020-08)
# For Watsco "mgc"
#export PATH="$HOME/work/clients/baker/repo:$PATH"

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

# DEPRECATED (2020-08)
# Force MySQL 5.7 as the "mysql" version
#export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"


# -----------------------------------------------
# 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


# -----------------------------------------------
# Switch PHP version
# -----------------------------------------------

# DEPRECATED (2020-08)
# 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"

# DEPRECATED (2020-08)
# Use Homebrew php@7.2
#export PATH="/usr/local/opt/php@7.2/bin:$PATH"
#export PATH="/usr/local/opt/php@7.2/sbin:$PATH"

# DEPRECATED (2020-08)
# Use MAMP
#export PATH="/Applications/MAMP/bin/php/php5.6.37/bin:$PATH"


# -----------------------------------------------
# Custom aliases
# -----------------------------------------------

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

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

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

# Change project
alias cd_{projectName}="cd ~/work/repos/{clientName}/{projectName}"

# Composer memory fix
alias memcomposer="COMPOSER_MEMORY_LIMIT=-1 composer"

# DEPRECATED (2020-08)
# For n98-magerun
#alias magerun="n98-magerun.phar"

# DEPRECATED (2020-08)
# 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"