redhat7.9安装zsh以及常用插件
1 安装zsh并更改默认终端
#1.安装软件包
yum -y install zsh git
#2.更改默认终端
chsh -s /bin/zsh
然后再退出下终端,重新登录用echo $SHELL 查看环境是否是/bin/zsh
2 配置oh-my-zsh
#1.从git仓库中拉取oh-my-zsh
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh
#2.生成配置文件
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
3 安装高亮、自动补全插件
#1.安装高亮插件:zsh-syntax-highlighting
git clone https://gitee.com/dawnwords/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
#2.安装自动补全:zsh-autosuggestions
git clone https://gitee.com/lhaisu/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
#3.安装autojump目录跳转
git clone https://gitee.com/gentlecp/autojump.git
cd autojump
./install.py
4 插件配置
#配置文件中修改了2个地方
#第一个是主题ZSH_THEME="maran"
#第二个是plugins=( )
root@localhost.localdomain:/root # cat ~/.zshrc|grep -v "^#"|grep -v "^$"
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="maran"
plugins=(
git
sudo
zsh-autosuggestions
zsh-syntax-highlighting
autojump
)
source $ZSH/oh-my-zsh.sh
5.效果展示
补充:还有个有趣的插件pokemonsay
#1.安装cowsay
yum install -y epel-release
yum install -y cowsay
#2.安装pokemonsay
$ git clone http://github.com/possatti/pokemonsay
$ cd pokemonsay
$ ./install.sh