Realizing that I need more information on my CLI, I decided to pimp my shell more than just colorizing the prompt. I chose zsh and oh-my-zsh.
Visit the official Oh-My-ZSH webpage. The installation is pretty much straight forward, simply type this line below on the terminal:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
It will setup the account using zsh shell by default. Now, let’s colorize the shell. There are plenty of themes that can be used. But I chose to use Powerlevel10k from here.
Update: 14 Aug 2021:
Following steps for Oh-My-Zsh in the webpage, by typing:
$ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k$ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc$ echo 'ZSH_THEME="powerlevel10k/powerlevel10k"' >> ~/.zshrc
and then spawning the new console will trigger the p10k configuration
step.
If you see these screens below, then you might need to install the additional fonts from the website. I chose to download Meslo Nerd Font.
After the fonts have been downloaded, then add it into your Font library and setup your Terminal.app preferences to use this Font.
Re-run the configuration by issuing p10k configure
.
You’ll notice that there’s an Apple logo there. But if you are looking for on how to add what user and which machine am I having right now, then you can edit the ~/.p10k.zsh
and find then modify these lines. In this configuration, I chose to put username on the left segment…
… and not showing that context on the right segment by commenting it…
… comment this to make the context always on …
… then change the background and the foreground that suits you. If you need to know which number represent which color, you can visit FLOZz’ tips for Colors and Formatting webpage.
You can also add plugin such as zsh-syntax-highlighting. The installation for oh-my-zsh is here.
$ brew install zsh-syntax-highlighting
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Edit the .zshrc to this:
plugins=(
git
zsh-syntax-highlighting
)
Then, this is my final zsh theme looks like.
Happy Pimping!