- Official site of Zsh
- Official site of Oh My Zsh
- Official repository of Powerlevel10k
- Unofficial installation guide
Operating System | Tool |
---|---|
Ubuntu 22.04.2 LTS |
zsh 5.8.1 |
Each command is separate with a blank line, please execute them separately.
sudo apt install vim curl git
It's recommended to install Nerd Font in this step to avoid display problems.
If Nerd Font isn't properly installed, you will not be able to experience the full functionality of Powerlevel10k.
- Install dependencies:
sudo apt install fontconfig
- Download and install one of the nerd font:
- Install fonts:
- Move all fonts to
/usr/local/share/fonts/TTF
- If the directory doesn't exist, create one
- Rebuild the font cache with
fc-cache -f -v
- Move all fonts to
sudo apt install zsh
sudo chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Switch the theme to Powerlevel10k by editing the config file which located in /home/$USER/.zshrc
(~/.zshrc
).
Change the line ZSH_THEME="robbyrussell"
to ZSH_THEME="powerlevel10k/powerlevel10k"
.
Apply the changes by executing source /home/$USER/.zshrc
(source ~/.zshrc
).
The Powerlevel10k configuration wizard should be started automatically.
If it doesn't, execute p10k configure
to start the configuration wizard.
Choose your favorites configuration!
My personal favorite configs are: 3121132342221y1y
(Start from "Prompt Style")
Zsh-Completions
Additional completion definitions for Zsh.
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
Zsh-Autosuggestions
It suggests commands as you type based on history and completions.
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Zsh-Syntax-Highlighting
It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal.
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Finally, add the following configuration to .zshrc
:
plugins=(
git
zsh-completions
zsh-autosuggestions
zsh-syntax-highlighting
)
Apply the changes by executing source /home/$USER/.zshrc
(source ~/.zshrc
).
Enjoy your perfect terminal with fantastic looking, autosuggestions and syntax-highlighting~
Add the following lines to the end of .zshrc
file to anchor the prompt to the bottom of the terminal window.
# Fix prompt at the bottom of the terminal window
alias clear="clear && printf '\n%.0s' {1..100}"
printf '\n%.0s' {1..100}