跳至主要內容

Centos替换终端为zsh

CentosCentos小于 1 分钟约 148 字全民制作人ikun

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

可能遇到的问题:

image-20240708094510636
image-20240708094510636

解决:

~/.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.htmlopen in new window

上次编辑于:
贡献者: yunfeidog