This guide helps you install and beautify your terminal using Zsh, Oh My Zsh, Powerlevel10k, and powerful plugins via a single script.
install_zsh.sh
– Run this to install everything.README_zsh_setup.md
– This overview and further instructions.
chmod +x install_zsh.sh
./install_zsh.sh
exec zsh
p10k configure
sudo apt update && sudo apt install -y zsh git curl fonts-powerline
zsh
: The Z shell, a more powerful alternative tobash
.git
: Needed for cloning plugin repositories.curl
: For downloading install scripts.fonts-powerline
: Adds support for special glyphs/icons used by themes.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- Installs Oh My Zsh, a framework that manages Zsh configurations easily.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
- Adds a highly customizable and fast theme.
sed -i 's/ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc
- Updates the theme setting in
.zshrc
file to use Powerlevel10k.
# 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
git clone https://github.com/zsh-users/zsh-autosuggestions \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# z
git clone https://github.com/rupa/z \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/z
zsh-syntax-highlighting
: Colors your commands as you type, helping catch mistakes early.zsh-autosuggestions
: Suggests previously typed commands as you type.z
: Enables jumping to frequently used directories with fewer keystrokes.
sed -i 's/plugins=(git)/plugins=(git zsh-syntax-highlighting zsh-autosuggestions z)/' ~/.zshrc
- Ensures those plugins are loaded by Zsh by modifying
.zshrc
.
chsh -s $(which zsh)
- Makes
zsh
your default shell every time you open a terminal.
After running the script, restart your terminal or run:
exec zsh
Then go through Powerlevel10k configuration wizard. Answer based on your preferences.
If you want to reconfigure the look later:
p10k configure
If this command doesn't work, try:
source ~/.zshrc