Final rendering

steps

1. Download iTerm2

Mac The dash terminal is used by default. You can run the ZSH command to change the dash terminal. By default, ZSH is used: CHSH -s /bin/zsh To change the dash terminal back to the default terminal, run the CHSH command as well

2. Install Oh My ZSH

Either of the two installation methods is availableCurl setup
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# wget installation mode
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Copy the code

If errors are reported in the preceding two methods, perform the following operations to manually install the device:

# Download oh-my-zsh source code
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
Copy the.zshrc configuration file to the root directory
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
Let the.zshrc configuration file take effect
source ~/.zshrc
Copy the code

3. Install the PowerLine

PIP install powerline-status –user install PIP sudo easy_install PIP sudo easy_install PIP At this point, python3 is installed and used by default as follows:

  • Install homebrew./bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  • Update the brew.brew update
  • Install python3.brew install python
  • Check whether Python3 is installed successfully./usr/local/Cellar/Check whether there is a directory starting with PYTHon3 in the directory. If yes, the installation is successful
  • Specify PYTHon3 as the default environment.
The path behind Cellar is modified based on your actual Python version
export PATH=${PATH}:/usr/local/ Cellar/[email protected]/3.9.6 / binalias python=/usr/local/ Cellar/[email protected]/3.9.6 / bin/python3alias pip=/usr/local/ Cellar/[email protected]/3.9.6 / bin/pip3Copy the code

4. Install PowerFonts

To install the font library, first clone the project git locally and then execute install.sh in the source code. Create a new folder in your preferred location, such as /Users/ DJ/openSource

mkdir /Users/dj/opensource
cd /Users/dj/opensource
Copy the code
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
Copy the code

Once the Font library is installed, set the Font for iTerm2 by iTerm2 -> Preferences -> Profiles -> Text, select Change Font in the Font area and locate the Meslo LG Font.

5. Install a color scheme

cd /Users/dj/opensource
git clone https://github.com/altercation/solarized
cd solarized/iterm2-colors-solarized/
open .
Copy the code

In the finder window that opens, double-click Solarized dark. itermcolors and Solarized light. itermcolors to install the Light and Dark colors. Go to iTerm2 -> Preferences -> Profiles -> Colors -> Color Presets and select one of the two Colors according to your Preferences.

6. Install the theme

Download the Agnoster theme and execute the script to install:

cd /Users/dj/opensource
git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git
cd oh-my-zsh-agnoster-fcamblor/
./install
Copy the code

After the copy is complete, run the vim ~/. ZSHRC command to open the ZSHRC configuration file and change the field next to ZSH_THEME to agnoster.

performsource ~/.zshrcMake the configuration file take effect.

7. Install the highlight plug-in and command completion plug-in

CD ~/.oh-my-zsh/custom/plugins/ # clone https://github.com/zsh-users/zsh-autosuggestions vi ~/.zshrcCopy the code

At this point we open the ZSHRC file for editing. Adding zsh-syntac-highlighting and command completion should be the last plugin for considering git. Source ~/.oh-my-zsh/custom/plugins/ ZSH -syntax- considering/ZSH -syntax- considering. ZSH, Run source ~/.zshrc for the file to take effect.

8. Change the background image

Replace the BackGround Image by iTerm2 -> Preferences -> Profiles -> Window -> BackGround Image.

Refer to the article

  • www.jianshu.com/p/7de00c73a…
  • www.jianshu.com/p/9c3439cc3…

There were some minor problems in the configuration process according to the reference article (Powerline failed due to incorrect Python version, Oh my ZSH failed to be installed due to network problems, etc.), so this article records the configuration process