linux-tutorial/codes/linux/ops/soft/zsh-install.sh

28 lines
811 B
Bash
Raw Normal View History

2018-10-09 13:54:15 +08:00
#!/usr/bin/env bash
2019-05-07 14:29:16 +08:00
cat << EOF
2018-10-09 13:54:15 +08:00
###################################################################################
# 安装 zsh、oh-my-zsh 脚本
2019-05-07 14:29:16 +08:00
# @system: 适用于 CentOS
# @author: Zhang Peng
# See: https://github.com/robbyrussell/oh-my-zsh
2018-10-09 13:54:15 +08:00
###################################################################################
2019-05-07 14:29:16 +08:00
EOF
2018-10-09 13:54:15 +08:00
2019-05-07 14:29:16 +08:00
echo -e "\n>>>>>>>>> install zsh"
2018-10-09 13:54:15 +08:00
yum install -y zsh
2019-05-07 14:29:16 +08:00
echo -e "\n>>>>>>>>> install oh-my-zsh"
2018-10-09 13:54:15 +08:00
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
# 替换 oh-my-zsh 主题
sed -i "s#^ZSH_THEME=.*#ZSH_THEME=\"ys\"#g" ~/.zshrc
# 下载 incr.zsh 补全插件
wget http://mimosa-pudica.net/src/incr-0.2.zsh
cp incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/
echo "source ~/.oh-my-zsh/plugins/incr/incr*.zsh" >> ~/.zshrc
# 更新配置
source ~/.zshrc