CentOS 7.x terminal mounting ZSH

A mounting base assembly

  1. First execute yumcommands required to install the zshoriginal program with gitprogram pullcode.

    yum install -y zsh git
  2. Installation oh my zshscript (this step needs to be installed git).

    wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
  3. Use which zshto view zshthe installation directory, usually stored in the /usr/bin/zshdirectory.

    which zsh
  4. Use the chshcommand to switch the shell program uses.

    chsh -s /usr/bin/zsh

Second, be optional

2.1 Installation ZSH icon fonts

Execute the following command in the current directory pulling icon warehouses, and switch to its directory, execute ./install.shscripts to install successfully.

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

2.2 replacement ZSH theme

Use vitools to edit /root/.zshrcthe file, change the ZSH_THEME="robbyussell"field to ZSH_THEME="agnoster"field, and by source ~/.zshrcthe command update their profiles.

2.3 Plug

The reason for using ZSH replace the original SHELL most important thing is to use its powerful plug-ins, where only recommended to install three plug-ins, they are wd, zsh-syntax-highlighting, zsh-autosuggestions.

First, in turn execute the following command, the latter two cloned into the plug-warehouse at Oh My Zsh plugins directory.

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 completion of the cloning operation, then the full path are two plug-ins:

/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 viediting ~/.zshrcfiles.

# 其他内容
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
# 其他内容

After editing is completed, the execution source ~/.zshrccommand to update ZSH configuration, the final effect as in FIG.

Guess you like

Origin www.cnblogs.com/myzony/p/11414490.html