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

31 lines
952 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-09 11:26:06 +08:00
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; }
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 补全插件
2019-07-11 16:52:03 +08:00
wget http://mimosa-pudica.net/src/incr-0.2cd.zsh
mkdir ~/.oh-my-zsh/plugins/incr/
2019-05-09 11:26:06 +08:00
mv incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/
2018-10-09 13:54:15 +08:00
echo "source ~/.oh-my-zsh/plugins/incr/incr*.zsh" >> ~/.zshrc
# 更新配置
source ~/.zshrc