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
zshandzsh-completionspackages 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
rbenvsetup code from my.bash_profileto my.zshrcfile:export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" - Added aliases, ENV variables, and functions e.g.
docker_startfrom my.bash_profileto my.zshrcfile - 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
zshin my.vimrcfile: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.