Customization



Oh My Zsh

  • Zsh is a terminal built on the same shell as bash and is now the default on Macs.
  • Oh My Zsh is a framework that wraps around the zsh terminal and allows use of plugins and themes.

Installation

To install Oh My Zsh:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

To install Powerlevel10k theme:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

To install plugins for the terminal:

  • Auto suggestions

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    
  • Auto highlighting commands

    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    
  • Auto completions

    git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
    

P10k fonts

Though not necessary, the Powerlevel10k theme has recommended fonts. Install them here.

Updating .zshrc

All of the configuration settings for OMZ will be in the ~/.zshrc file.

  • To update, in the terminal enter:

    nano ~/.zshrc
    
  • To change the zsh_theme:

    ZSH_THEME="powerlevel10k/powerlevel10k"
    
  • Add this into the plugins section:

      plugins=(
              git
              zsh-autosuggestions
              zsh-syntax-highlighting
              zsh-completions
      )
    
  • This is added to bash_profile when anaconda is installed.

    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
            . "/opt/anaconda3/etc/profile.d/conda.sh"
        else
            export PATH="/opt/anaconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    
  • Close and re-open Terminal to go through powerlevel10k installation.

To reconfigure the powerlevel10k theme:

p10k configure