安装zsh
-
下载
https://sourceforge.net/projects/zsh/files/
目前最新版本为5.8
-
安装依赖
yum install -y ncurses-devel
-
编译
tar xvf zsh-5.8.tar.xz
cd zsh-5.8
./configure
make
make install
# By default, make install will install all the files in /usr/local/bin,/usr/local/lib etc.
# --prefix, 指定安装目录
# --exec-prefix zsh执行文件的安装目录
#
-
将默认shell切换为zsh
chsh -s /usr/local/bin/zsh #CentOS 7
usermod -s /usr/local/bin/zsh root #CentOS 8
reboot # 重启后才会生效
# 将zsh加入/etc/shells
vim /etc/shells
/usr/local/bin/zsh
-
安装oh-my-zsh美化插件
# via wget
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
# via curl
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
安装高亮插件
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions
git clone https://github.com/zsh-users/zsh-history-substring-search
vim ~/.zshrc
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
zsh-completions
zsh-history-substring-search
)
网友评论