Newer Mac OS uses ZSH instead of bash
. This wiki will talk through setting it up with nice features such as autocomplete, colorized ls
, git & conda aware prompts etc.
- After upgrading to
zsh
, confirm you have it by typingzsh
in terminal. - Install a framework such as Oh my zsh which will simplify the whole process. Rest of steps assume you have it running. As of today, you can install it by running
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
.
Restart terminal.
- Look at available plugins and enable the ones you need. You can do so by editing the
.zshrc
file as
subl ~/.zshrc
Add necessary plugins (separated just by a single space or new line) to the plugins
tuple. I added git pipenv pip zsh-interactive-cd
. Restart terminal.
- Add conda by pasting the following. Note you may have to edit the
username
accordingly. To know your username, type$ whoami
and use what it returns.
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/username/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/username/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/username/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/username/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
Restart terminal. This will prefix the env name in parenthesis before your terminal.