How to install ZSH terminal in CentOS 7.x

How to install ZSH terminal in CentOS 7.x

1. Install basic components

First, execute the yum command to install the required zsh original program and git program to pull the code.

yum install -y zsh git

Install the oh my zsh script (this step requires git to be installed).

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

Use which zsh to view the installation directory of zsh , which is generally stored in the /usr/bin/zsh directory.

which zsh

Use the chsh command to switch the shell program used.

chsh -s /usr/bin/zsh

2. Perform optional configuration

2.1 Installing ZSH Icon Font

Execute the following command to pull the icon repository in the current directory, switch to its directory, and execute the ./install.sh script to successfully install it.

git clone https://github.com/powerline/fonts.git

2.2 Change ZSH theme

Use the vi tool to edit the /root/.zshrc file, change ZSH_THEME="robbyussell" field to the ZSH_THEME="agnoster" field, and update their configuration files through the source ~/.zshrc command.

2.3 Installing plugins

The main reason for using ZSH to replace the original SHELL is to use its powerful plug-ins. Here we only recommend installing three plug-ins, namely wd , zsh-syntax-highlighting , and zsh-autosuggestions .

First, execute the following commands in sequence to clone the repositories of the following two plug-ins into the plug-in directory of Oh My Zsh.

cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
git clone https://github.com/zsh-users/zsh-autosuggestions.git

After the cloning operation is completed, the full paths of the two plug-ins are:

/root/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-syntax-highlighting.zsh
/root/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

Continue to use vi to edit the ~/.zshrc file.

# Other content plugins=(
 git
 wd
 zsh-syntax-highlighting
 zsh-autosuggestions
)

source /root/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-syntax-highlighting.zsh
source /root/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source $ZSH/oh-my-zsh.sh
# Other content

After editing, execute the source ~/.zshrc command to update the ZSH configuration. The final effect is as shown below.

Summarize

The above is the configuration method of installing ZSH terminal in CentOS 7.x introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

<<:  MySQL incremental backup and breakpoint recovery script example

>>:  Implementing license plate input function in WeChat applet

Recommend

Mobile browser Viewport parameters (web front-end design)

Mobile browsers place web pages in a virtual "...

Simple web page code used in NetEase blog

How to use the code in NetEase Blog: First log in...

Solution to Docker disk space cleaning

Some time ago, I encountered the problem that the...

Detailed tutorial for installing mysql 8.0.12 under Windows

This article shares with you a detailed tutorial ...

MySQL 8.0 installation tutorial under Linux

This article introduces how to install MySQL 8.0 ...

Solution for Tomcat to place configuration files externally

question When we are developing normally, if we w...

WeChat applet implements the Record function

This article shares the specific code for the WeC...

MySQL SQL statement to find duplicate data based on one or more fields

SQL finds all duplicate records in a table 1. The...

Summary of Linux user groups and permissions

User Groups In Linux, every user must belong to a...

Explain TypeScript enumeration types in detail

Table of contents 1. Digital Enumeration 2. Strin...

Example code for implementing hollowing effect with CSS

Effect principle Mainly use CSS gradient to achie...

Detailed explanation of the difference between $router and $route in Vue

We usually use routing in vue projects, and vue-r...