ZSH, also called the Z shell, is an extended version of the Bourne Shell (sh), with plenty of new features, and support for plugins and themes.
This is a framework for zsh
Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience.
This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.
As you type commands, you will see a completion offered after the cursor in a muted gray color. If you press the → key (forward-char widget) or End (end-of-line widget) with the cursor at the end of the buffer, it will accept the suggestion, replacing the contents of the command line buffer with the suggestion.
# ZSH is installed by default in MacOs.
# To make it the default shell run this
chsh -s $(which zsh)
Follow the instruction here https://ohmyz.sh/ Or use this snippet:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install the fonts:
https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
cd ~/Library/Fonts && {
curl 'https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Regular.ttf' --output 'MesloLGS NF Regular.ttf'
curl 'https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold.ttf' --output 'MesloLGS NF Bold.ttf'
curl 'https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Italic.ttf' --output 'MesloLGS NF Italic.ttf'
curl 'https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20Bold%20Italic.ttf' --output 'MesloLGS NF Bold Italic.ttf'
cd -; }
Open Terminal → Preferences → Profiles → Text
, click Change beside Font and select MesloLGS NF family
mkdir -p ~/.zsh
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.zsh/powerlevel10k
echo 'source ~/.zsh/powerlevel10k/powerlevel10k.zsh-theme'>>~/.zshrc
Exit the Terminal. Open it again and follow the wizard to configure the theme. Refer to the new zshrc file for the final configuration.
We can change the .p10k.zsh
at POWERLEVEL9K_DIR_BACKGROUND
:
typeset -g POWERLEVEL9K_DIR_BACKGROUND=5
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
echo 'source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh'>>~/.zshrc
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
echo 'source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh'>>~/.zshrc
Download this file. Move it to ~/.zsh/
.
https://github.com/minhanhhere/developer-tools/raw/main/powerlevel10k/git-completion.bash
mkdir -p ~/.zsh && cd ~/.zsh && {
curl -O 'https://raw.githubusercontent.com/minhanhhere/developer-tools/main/powerlevel10k/git-completion.bash'
cd -; }
echo "
# Load Git completion
zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
fpath=(~/.zsh \$fpath)
autoload -Uz compinit && compinit
">>~/.zshrc
Recommended: Download this and replace with your .zshrc
https://github.com/minhanhhere/developer-tools/raw/main/powerlevel10k/.zshrc
Original instruction here: https://dev.to/pratik_kale/customise-your-terminal-using-zsh-powerlevel10k-1og5