terminal-powerlevel10k
sudo apt update
sudo apt install zsh
Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
When installing Oh My Zsh, it will ask you to change the default shell to zsh. Type y
to change the default shell to zsh.
Install Powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Official doc: https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#oh-my-zsh
sudo vim ~/.zshrc
ZSH_THEME="robbyrussell"
ZSH_THEME="powerlevel10k/powerlevel10k"
Fonts
Powerlevel10k requires a set of fonts to display the icons correctly. Follow the official doc to install the fonts.
NOTE: I am using MacOS to remote to the Ubuntu server, so I need to install the fonts on the MacOS side.
Configure Powerlevel10k
Then, reopen the zsh terminal, it will ask you to configure the powerlevel10k theme. Follow the instructions to configure it.
This is Powerlevel10k configuration wizard. You are seeing it because you haven't
defined any Powerlevel10k configuration options. It will ask you a few questions and
configure your prompt.
Does this look like a diamond (rotated square)?
reference: https://graphemica.com/%E2%97%86
---> <---
(y) Yes.
(n) No.
(q) Quit and do nothing.
Choice [ynq]:
Plugins
Install the zsh-autosuggestions plugin:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Add the plugin to the ~/.zshrc
file:
plugins=(git)
plugins=(git zsh-autosuggestions)
After resource the ~/.zshrc
file source ~/.zshrc
, the zsh-autosuggestions plugin will work.
Install the zsh-syntax-highlighting plugin:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Add the plugin to the ~/.zshrc
file:
plugins=(git zsh-autosuggestions)
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
After resource the ~/.zshrc
file source ~/.zshrc
, the zsh-syntax-highlighting plugin will work.