16

Customize your terminal on Manjaro using ZSH with powerlevel10k, Autosuggestion...

 2 years ago
source link: https://dev.to/shawon/customize-your-terminal-on-manjaro-using-zsh-with-powerlevel10k-autosuggestion-and-syntax-highlighting-plugin-3692
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Step 1. Install ZSH

sudo pacman -S zsh
Enter fullscreen modeExit fullscreen mode

Step 2. Make ZSH default

chsh -s $(which zsh)
Enter fullscreen modeExit fullscreen mode

Step 3. Install font for powerlevel10k

Download these four ttf files and then install by double clicking each of them.
*MesloLGS NF Regular.ttf
*MesloLGS NF Bold.ttf
*MesloLGS NF Italic.ttf
*MesloLGS NF Bold Italic.ttf

Step 4. Log Out / Restart your machine

Step 5. Change Terminal font

First of all make sure your default terminal is ZSH by echo $SHELL. The return should be /usr/bin/zsh

Then from terminal goto Settings > Edit Current profile > Appearance > Choose > MesloLGS NF

Step 6. Powerlevel10k installation

Clone the repo

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k 
Enter fullscreen modeExit fullscreen mode

Source the powerlevel10k theme script in your .zshrc

echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
Enter fullscreen modeExit fullscreen mode

Step 7. Configure Powerlevel10k

Close and reopen terminal. You should prompt with powerlevel10k configuration

If you don't get anything like this then run p10k configure

Step 8 (Optional). Fix "p10k configure: cannot create /usr/share/zsh/p10k.zsh because /usr/share/zsh is readonly" error

After running p10k configure if you get this error follow this step.

kate /usr/share/zsh/manjaro-zsh-prompt
Enter fullscreen modeExit fullscreen mode

You can use nano or other text editor instead of kate

Now put a # at the beginning of line 15 or copy and replace this at line 15 then save the file.

#[[ ! -f /usr/share/zsh/p10k.zsh ]] || source /usr/share/zsh/p10k.zsh
Enter fullscreen modeExit fullscreen mode

Now close and open terminal again to get the configuration wizard.

Step 9. Install Autosuggestion and Syntax Highlighting Plugin

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

echo 'source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh'>>~/.zshrc 
Enter fullscreen modeExit fullscreen mode

Run these 4 command then restart the terminal and see the magic!!!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK