DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Zsh
Install and setup Zsh

Install

Install Zsh.
1
brew install zsh
Copied!
Install Oh My Zsh.
1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Copied!
Upgrade it.
1
upgrade_oh_my_zsh
Copied!
Change theme
Edit the config file.
1
nano ~/.zshrc
Copied!

References

Change theme.

1
#ZSH_THEME="robbyrussell"
2
ZSH_THEME="agnoster"
Copied!
Reload the config.
1
source .zshrc
Copied!

References

Install fonts

Run.
1
git clone https://github.com/powerline/fonts.git
2
cd fonts
3
./install.sh
Copied!
Change your iTermr2 font to Meslo LG L for Powerline.

Fixes

Autocomplete

Put these two lines at the end of my .zshrc
1
autoload -Uz compinit
2
compinit
Copied!

Slow cd to git folder

1
git config --add oh-my-zsh.hide-status 1
2
git config --add oh-my-zsh.hide-dirty 1
Copied!

Shorten path

Edit your theme confi file.
1
cd ˜/.oh-my-zsh/themes/
2
vi agnoster.zsh-theme
Copied!
Edit the file as follows.
1
prompt_dir() {
2
#prompt_segment blue $CURRENT_FG '%~'
3
prompt_segment blue $CURRENT_FG '%2~'
4
}
Copied!
Apply changes.
1
source ˜/.zshrc
Copied!

Update ZSH after the change

1
cd ~/.oh-my-zsh
2
git stash
3
upgrade_oh_my_zsh
4
git stash pop
Copied!

References