iterm2+zsh+oh-my-zsh+powerlevel10k

Download iterm2

Method 1: download from the official website

iterm2.com/

Method 2: Baidu cloud download

Link: pan.baidu.com/s/1ZZnTDbVc…

Password: concern public number [Mr. Dot nine] reply: iterm2 can be obtained

2. Install ZSH

ZSH is installed on MacOS by default and can be used directly

$CHSH -s /bin/ ZSH = $CHSH -s /bin/ ZSH

Install oh my ZSH

  • Use the curl

Sh -c “$(curl – fsSL raw.githubusercontent.com/robbyrussel…). “

  • Using wget

Sh -c “$(wget raw.githubusercontent.com/robbyrussel… -O -)”

  • Download the source code

## Download the source code
git clone https://github.com/robbyrussell/oh-my-zsh 
Run the install command
cd oh-my-zsh/tools sh install.sh
Copy the code

4. Download themes

cd ~/.oh-my-zsh/themes sudo git clone https://github.com/romkatv/powerlevel10k.git
Copy the code

Download fonts

Method 1: official download

nerdfonts.com/

If you are using a MAC, double-click the font to install it. Then modify the oh my ZSH variable file ~/.zshrc. Modify variable POWERLEVEL9K_MODE=’nerdfont-complete’

Method 2: Baidu cloud download

Link: pan.baidu.com/s/1ZZnTDbVc…

Password: concern public number [Mr. Dot nine] reply: iterm2 can be obtained

Set the font

Download the plugin

cd ~/.oh-my-zsh/plugins 
sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git 
sudo git clone git://github.com/zsh-users/zsh-autosuggestions 
Copy the code

Viii. System configuration

Export ZSH=”/Users/dianjiu/. Oh-my-zsh “where username dianjiu is changed to your username

sudo vim ~/.zshrc
Copy the code
# Prompts
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0C0'
#POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0C0'
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0C2'
#POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0C2'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir dir_writable vcs virtualenv)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs command_execution_time ip)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K_SHORTEN_DELIMITER=..
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=$'\n'
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="\uF460%F{073}\uF460%F{109}\uF460%f "
export ZSH="/Users/dianjiu/.oh-my-zsh"
POWERLEVEL9K_MODE='nerdfont-complete'
ZSH_THEME="powerlevel10k/powerlevel10k"
export UPDATE_ZSH_DAYS=13
HIST_STAMPS="yyyy/mm/dd"
plugins=(
    git
    colored-man-pages
    colorize
    github
    brew
    osx
    docker
    docker-compose
    zsh-autosuggestions
    zsh-syntax-highlighting
    autopep8
    python
)
source $ZSH/oh-my-zsh.sh
alias zshconfig="vim ~/.zshrc"
alias vimconfig="vim ~/.vimrc"
alias ansibleconfig="vim ~/.ansible/ansible.cfg"
alias grep='grep --color=auto'
Copy the code
source ~/.zshrc
Copy the code

9. Exception handling

Fault 1: An error occurs when a plug-in is downloaded

Cloning into 'zsh-syntax-highlighting'. fatal: unable to access'https://github.com/zsh-users/zsh-syntax-highlighting.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Copy the code

Problem solving

git config --global http.postBuffer 4194304000
Copy the code
sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git 
Password: 
Cloning into 'zsh-syntax-highlighting'. remote: Enumerating objects: 6913,done. remote: Total 6913 (delta 0), reused 0 (delta 0), pack-reused 6913 Receiving objects: 100% (6913/6913) and 1.45 MiB | 64.00 KiB/s,done. Resolving deltas: 100% (4675/4675), done.
Copy the code

Problem two: FONTS on VScode terminals are garbled

Add it to setting.json

"terminal.integrated.fontFamily": "Hack Nerd Font".Copy the code

X. References

www.jianshu.com/p/609c1f554…

www.jianshu.com/p/7162c4b7a…