This article only records the process of changing a new device and configuring the terminal system. Personally, I think the terminal of Mac system is enough for daily use. I also used iTem2, which is also good.

function

  • Syntax highlighting
  • Command line TAB completion
  • Autoprompt
  • Git repository status is displayed
  • And, of course, the beautiful interface

The color scheme

To use Solarized theme color schemes, click 👇 to download:

Click here to download latest version

To get the unzipped directory: Double-click to install Solarized Dark ANSI

Oh – my – ZSH installation

Install with CRUL:

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

Or use wget:

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

The theme

After the installation is successful, open the hidden.zshrc file with vim(or find it in the root directory) and change the theme to agnoster:

ZSH_THEME="agnoster"
Copy the code

The agnoster theme requires special font support, otherwise there will be garbled situation, then we configure the font:

  • Download and install Meslo fonts

  • Use Meslo font in terminal:

Agnoster is the theme used by most people. I personally use YS. You can go to the official website of Oh-my-ZSH to choose other themes

Click on the theme

Automatic prompt command configuration

  • Effect:

When we enter the command, the terminal will automatically prompt you the command you may enter next, then press → to output these commands, which is very convenient, as shown in the figure:

  • The automatic prompt function is as follows:

1. Clone the repository to the ~/. Oh-my-zsh /custom/plugins directory

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

2. Open the.zshrc file using vim(or in the root directory) and find plugins=(git).

plugins=(zsh-autosuggestions git)
Copy the code

Syntax highlighting configuration

1. Install zsh-syntax-highlighting plug-ins using Homebrew.

brew install zsh-syntax-highlighting
Copy the code

2. Configure the. ZSHRC file and insert a line.

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Copy the code

3. Enter the command.

source ~/.zshrc
Copy the code

PS:

Install the Homebrew package management tool:

1. Download the source file to the local PC

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
Copy the code

2. Modify the image source

will

BREW_REPO = "https://github.com/Homebrew/brew".freeze
Copy the code

Change to (copy directly if CORE_TAP_REPO is not found)

BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
CORE_TAP_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git".freeze
Copy the code

3. Console input

/usr/bin/ruby brew_install
Copy the code

The source used here is cas and may appear

fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
Failed during: /usr/local/bin/brew update --force
Copy the code

You need to perform

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
Copy the code

4. The mirror address of HomeBREW-Core is also set as the domestic mirror of CAS

cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git // Update the brew updateCopy the code

Security & Privacy -> any source

sudo spctl --master-disable
Copy the code

Set the unit password

pwpolicy -clearaccountpolicies
Copy the code

end!