centos7安装zsh

本文介绍如何在Linux环境下安装配置ZSH及OH-MY-ZSH,并实现自动补全功能。主要内容包括:使用YUM安装ZSH和GIT;通过GITHUB获取OH-MY-ZSH并设置为默认shell;安装ZSH-AUTOSUGGESTIONS插件以增强用户体验。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.安装zsh和git

yum install -y zsh && yum install -y git
#切换shell
[root@localhost hky]# chsh -s /bin/zsh 
Changing shell for root.
Shell changed.
#重启 shell 才会生效
[root@localhost hky]# reboot

2.安装 oh-my-zsh

如果下载很慢可以到gitee上面去,上面有很多镜像,如果下载插件也慢,同样也可以去gitee

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

3.zsh-autosuggestions 自动提示

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

修改~/.zshrc配置文件,把插件添加到plugin中,如下图

nvim ~/.zshrc

刷新配置

source ~/.zshrc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值