Switching from Bash to Zsh
After years of using Bash without ever really having chosen Bash, I recently switched my shell to Zsh. Why? Partly out of curiosity, and partly because I was fed up with my bash history not always being available in multiple terminals simultaneously.
Here’s how I made the switch:
- Installed the latest
zsh
andzsh-completions
packages via Homebrew:brew update brew install zsh brew install zsh-completions
- Installed Oh-My-Zsh
- Chose my preferred theme - I went with avit
- Added the
rbenv
setup code from my.bash_profile
to my.zshrc
file:export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
- Added aliases, ENV variables, and functions e.g.
docker_start
from my.bash_profile
to my.zshrc
file - Copied my bash history over to my zsh history using Ankit Goyal’s fantastic import bash history to zsh history script.
- Set my shell to
zsh
in my.vimrc
file:set shell=/usr/local/bin/zsh
- Enabled any relevant plugins for my workflow e.g. git, gitfast, docker.
It’s now about two weeks since I made the switch and I’ve not looked back. Granted, zsh won’t be for everyone. But you’ve got to at least give these things a try.