rendering

  • macos

There’s a cute little apple icon on the front,cdThe command color is highlighted, followed by graytesseraThe directory is the directory entered last time. Press ➡️ to directly fill in the directory

  • ubuntu

Install the ZSH

Virtual terminal, bash compatible

  • macos

ZSH is already installed on your MAC by default, just toggle

chsh -s /bin/zsh
Copy the code

To restore, run CHSH -s /bin/bash

  • ubuntu
sudo apt install zsh
chsh -s /bin/zsh
Copy the code

Oh – my – ZSH installation

Curl is based on the ZSH command line, is a wrapper for ZSH, provides the theme configuration, plug-in mechanism

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Copy the code

wget

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
Copy the code

Install the Powerlevel9k/Powerlevel10k theme

The most used theme for ZSH

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
Copy the code

Edit ~ /. ZSHRC set ZSH_THEME = “powerlevel10k/powerlevel10k”.

Add one more line of configuration :POWERLEVEL9K_MODE=” awes-patched”

Install the fonts

  • ubuntu
apt-get install fonts-powerline
Copy the code
  • macos
https://github.com/powerline/fonts/blob/master/SourceCodePro/Source%20Code%20Pro%20for%20Powerline.otf
https://github.com/Falkor/dotfiles/blob/master/fonts/SourceCodePro%2BPowerline%2BAwesome%2BRegular.ttf
Copy the code

Open the downloaded font, then click Install Font. Set the Font in iTerm2 (Preperence->Profiles->Text→Change Font), select Source Code Pro + Font Awesome, size 18, preferably for both “Font” and “non-ASCII Font”. Restart iTerm2 for all changes to take effect.

ZSH configuration topic

source ~/.zshrc
Copy the code

Alternatively, run the following command to reconfigure the configuration

p10k configure
Copy the code

Start configuring Powerlevel10k and select 1234 or Yes or no as prompted

Iterm2 Topic configuration (for MAC)

Download topic :iterm2colorschemes.com Preperence->Profiles->Colors->color Presets, click Import, select the directory you just decompressed, click schemes in the directory, select the theme you want to import (you can import all of them), and choose your favorite theme, for this I chose ubuntu theme

Some commonly used plug-ins

zsh-autosuggestions

Download the plugin

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
Copy the code

Edit ~/.zshrc to set plugins

plugins=(zsh-autosuggestions git)
Copy the code

Enable plug-ins

source ~/.zshrc
Copy the code

If the command you typed last time is displayed, press the right arrow key ➡️ to confirm filling the previous command

zsh-syntax-highlighting

Download the plugin

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
Copy the code

Write to configuration

echo "source $ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
Copy the code

Enable plug-ins

source ~/.zshrc
Copy the code

Commands are automatically highlighted

TIP:

Macos: $ZSH_CUSTOM Default /Users/YOURNAME/. Oh-my-zsh /custom