System Information
- Ubuntu 22.10 kinetic
Install zsh
echo $SHELL # Check the current shell
cat /etc/shells # List installed shells on the system
sudo apt update && apt full-upgrade -y
sudo apt install zsh -y # Install zsh
Set zsh as the Default Shell
sudo chsh -s /bin/zsh
sudo reboot # Reboot the system
echo $SHELL # Verify the switch was successful
Install Oh My Zsh
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Configure Oh My Zsh Theme
# Open the configuration file
vim ~/.zshrc
# Change the theme
ZSH_THEME="random"
# Apply the changes
source ~/.zshrc
ZSH_THEME="" disables any theme.
ZSH_THEME="random" picks a random theme each time.
echo $RANDOM_THEME prints the name of the current theme.
To choose a random theme from a list of favorites:
ZSH_THEME="random"
ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "cloud" )
Install Powerline Fonts
sudo apt install fonts-powerline -y
Configure Oh My Zsh Plugins
Syntax Highlighting Plugin - zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Auto-suggestions Plugin - zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
.zshrc File Configuration
# Open the configuration file
vim ~/.zshrc
# Find plugins=(xxx)
plugins=(git extract zsh-syntax-highlighting zsh-autosuggestions)
# Save and exit vim
source ~/.zshrc # Apply the changes
Note: zsh-autosuggestions must always be placed last to work correctly.