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

MySQL slow query pitfalls

Table of contents 1. Slow query configuration 1-1...

Implementation of Docker batch container orchestration

Introduction Dockerfile build run is a manual ope...

How to get form data in Vue

Table of contents need Get data and submit Templa...

How to use css variables in JS

How to use css variables in JS Use the :export ke...

How to use shell scripts in node

background During development, we may need some s...

Analysis and solutions to problems encountered in the use of label tags

I used the label tag when I was doing something re...

An analysis of div+float, a very important concept in website design

In website construction, you will always encounter...

Pure js to achieve typewriter effect

This article example shares the specific code of ...

Operate on two columns of data as new columns in sql

As shown below: select a1,a2,a1+a2 a,a1*a2 b,a1*1...

Detailed tutorial on installing and configuring MySql5.7 on Ubuntu 20.04

Table of contents 1. Ubuntu source change 2. Inst...