Terminal for Mac


1. Install Iterm2

# Install iterm2
cd myfolder
brew cask install iterm2

2. Install Z-shell

# Install ZSH
brew install zsh

# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# Source .bash_profile
source ~/.bash_profile

# If you use conda environment
conda init zsh

3. Install Color Scheme

git clone git@github.com:mbadolato/iTerm2-Color-Schemes.git

'Go to iTerm2 > Preferences > Profile > Colors > Color Presets > Import > Select Folder iTerm2-Color-Schemes/Schemes/yourfavouritecolor'

4. Install powerline font

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

vim ~/.zshrc
  ZSH_THEME="agnoster"

# Clone
git clone https://github.com/powerline/fonts.git --depth=1

# Install fonts
cd fonts
./install.sh

# Clean-up
cd ..
rm -rf fonts

'Go to iTerm2 > Preferences > Profile > Text > ChangeFont'

Terminal


5. Get miniconda working in Oh My ZSH

open ~/.bash_profile
open ~/.zshrc
'''
# Copy below from ~/.bash_profile to ~/.zshrc

# added by miniconda3 5.3.0 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/miniconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/miniconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<
'''
# Add the below line in ~/.zshrc file
export PATH="~/Users/j/miniconda3/bin:$PATH"

# Restart zshell
source ~/.zshrc

6. Add zsh syntax highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git

echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc


References