The Centos terminal is too simple to use. I thought about changing to zsh terminal and matching the theme of oh my zsh. So create a different terminal.
Installing ZSH
We can use the yum command or source code to compile and install. (yum) If installed, the zsh version may be lower. Many themes require higher versions of zsh, so I am using source code installation here.
First, we go to zsh's official website to download the latest version of zsh (http://zsh.sourceforge.net/Arc/source.html)
# download
wget https://sourceforge.net/projects/zsh/files/zsh/5.9/zsh-5.9.tar.xz
# Uncompression
tar xvf zsh-5.9.tar.xz
cd zsh-5.9
#Compile and install
./configure
make make install
After the compilation and installation, you need to add zsh to /etc/shells
vim /etc/shells
#Add content as follows
/usr/local/bin/zsh
The purpose of the above command is to add zsh to the shell environment. Pay attention to the road strength of zsh. If you are not sure, you can check it through the whereis zsh command.
At this point, our zsh installation is completed. Next we need to install oh-my-zsh
Installing oh-my-zsh
Project address: https://github.com/ohmyzsh/ohmyzsh
One-click installation
sh -c '$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)'
After the installation is completed, you will be asked whether you use zsh as the default shell. Select Y here and press Enter
Seeing this interface, the installation of oh-my-zsh is completed
Configure oh-my-zsh
After the installation is completed, we need to make a simple design for Chinese displays, etc.
# Edit configuration file
vim ~/.zshrc
# Add the following three lines respectively
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
source /etc/profile
# Save and update
source .zshrc
Installing plug-ins
zsh has many fun plug-ins. The installed plug-ins are in the ~/.oh-my-zsh/custom/plugins directory by default. Such as our commonly used syntax highlighting, historical command prompts, and path completion. Complete command plugin git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions syntax highlighting plugin git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Next, we need to put the two downloaded plugins into the zsh configuration file. Edit the plugins=() option of the .zshrc file, and then source .zshrc
Installing oh-my-zsh
oh-my-zsh comes with many themes, all of which are placed in the ~/.oh-my-zsh/themes directory, and you can change them at will. To change the theme, you only need to replace ZSH_THEME='Theme Name' in the .zshrc file and source ~/.zshrc. The default theme is robbyrussell. We change the theme to: agnoster
Final effect
Of course, you can also download other topics you like on git.
Recommended Comments