forked from dunwu/linux-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzsh-install.sh
More file actions
29 lines (22 loc) · 917 Bytes
/
zsh-install.sh
File metadata and controls
29 lines (22 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
cat << EOF
###################################################################################
# 安装 zsh、oh-my-zsh 脚本
# @system: 适用于 CentOS
# @author: Zhang Peng
# See: https://github.com/robbyrussell/oh-my-zsh
###################################################################################
EOF
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; }
echo -e "\n>>>>>>>>> install zsh"
yum install -y zsh
echo -e "\n>>>>>>>>> install oh-my-zsh"
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
mv incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/
echo "source ~/.oh-my-zsh/plugins/incr/incr*.zsh" >> ~/.zshrc
# 更新配置
source ~/.zshrc