Setting up the iMac - zsh, Oh My Zsh & Dracula
10 Jul 2020
Setting up a new computer is refreshing and a chance to start over. So, this week when I finally decided to get my iMac from the office, I spent the first day setting up the shell, terminal, themes, git, vsc and this blog repo with ssh keys on Github. A big screen increases productivity and speeds up development.
Shell #
Let's check which shell I am using.
echo $0
Apple announced that the default shell in macOS 10.15 Catalina will be zsh
. bash
has been the default shell since Mac OS X 10.3 Panther. But, we'll need to switch this manually.
$ chsh -s /bin/zsh
This will prompt for your password. This command will not change the current shell. Close the current shell and open a new one.
Oh My Zsh #
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes,
I had setup Oh My Zsh on my MacBook and can’t do with out it anymore. Oh My Zsh is a layer on top of your zsh shell with a bunch of plugins to make your life easier. This is a fantastic article that I followed to get Oh My Zsh installed and working - Badassify your terminal and shell.
Here are my Oh My Zsh favourite plugins:
-
Syntax highlighting - It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.
-
Auto-Suggestions - It suggests commands as you type based on history and completions.
-
Double Tab after a cd command to get an interactive file list.
-
Better and more descriptive Git integration.
I followed this article Oh-My-Zsh! A Work of CLI Magic — Tutorial for Ubuntu
to install plugins and learn some shortcuts.
I customised the ~/.zshrc
to show the full path to my working directory. Add this line to the bottom of the file:
PROMPT=${PROMPT/\%c/\%~}
And now source the .zshrc file.
source ~/.zshrc
Dracula #
The colors of this theme are soothing so I decided to get it setup for zsh and Visual Studio Code.
Dark theme for Zsh and 107+ apps — Dracula
git clone https://github.com/dracula/zsh.git dracula
mv ~/dracula/dracula.zsh-theme ~/.oh-my-zsh/themes/dracula.zsh-theme
Open ~/.zshrc
and change the the line ZSH_THEME=”robbyrussell”
to ZSH_THEME=”dracula”
.
Source the ~/.zshrc
. If you get errors then you need to move the /lib
folder as mentioned here.
Dark theme for Visual Studio Code and 107+ apps — Dracula
The installation using the command palette is pretty straightforward.