Centos替换终端为zsh
小于 1 分钟约 148 字
Centos替换终端为zsh
安装zsh
yum install -y zsh
设置为默认的shell
chsh -s /bin/zsh
安装oh-my-zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
安装插件:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
可能遇到的问题:
解决:
将~/.bashrc
文件中的
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
替换为:
if [ -f /etc/bashrc ]; then
bash -c ". /etc/bashrc"
fi
解决zsh版本过低问题:https://shirolin.github.io/posts/d7590978/index.html