Oh My Zsh
If you reveal to someone you are using the bash shell in 2023, they are going to assume you have either been living under a rock, or you likely also have a Toyota Corolla ‘66 (…which, BTW, is the best Corolla). All the cool kids now use zsh.
What are we working with?
To look up which shell you are using, a tell-tale sign the prompt. If it has a $
, you likely have bash. If you have a %
, you likely have zsh. To confirm, do an echo $0
or echo $SHELL
.
Modernizing
To get you into the modern age of computing, you need to install the Z-shell. On MacOS, you likely already have zsh but, to get the latest version, run:
brew install zsh
On Debian-based Linux distributions, it’s:
apt update; apt install -y zsh
On RedHat-based Linux distributions, it’s:
yum install -y zsh
Now that you have Z-shell installed, make it your default shell with:
chsh -s $(which zsh)
For the change to take effect, log out and log in.
Doing More
To give your Z-shell super powers, you need “Oh My Zsh”. Run:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Next, download the syntax highlighting and auto-suggestions plugins with:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
…and:
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
…then, add them to the plugins list in the ~/.zshrc file, which should now look like this:
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)
Finally, activate the changes with:
source ~/.zshrc
Other Notes
Installing HomeBrew
If you do not yet have HomeBrew (the brew command) on MacOS, it’s easily installed with:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You might also have to install Xcode command line tools with:
xcode-select —-install
Listing the Shells on your System
You can view a list of all available shells in /etc/shells
.