【Linux安装和配置超炫酷的Shell - Zsh】

先看炫酷的效果

炫酷shell 任选
在这里插入图片描述

命令行高亮,一眼确认是否有误
在这里插入图片描述
自动补全是真香,不多说看下图:
在这里插入图片描述

安装zsh

sudo apt install -y zsh
zsh --version

在这里插入图片描述

安装oh-my-zsh

#curl
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#或者通过wget
 sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

如果github访问问题可使用gitee源

#curl
sh -c "$(curl -fsSL https://gitee.com/gloriaied/oh-my-zsh/raw/master/tools/install.sh)"

#wget
sh -c "$(wget https://gitee.com/gloriaied/oh-my-zsh/raw/master/tools/install.sh -O -)"

安装成功提示如下:
在这里插入图片描述

设为默认shell

#查看Linux安装的所有shell
cat /etc/shells

#zsh设为默认shell
chsh -s /bin/zsh 

#检查是否设置成功
echo $SHELL

在这里插入图片描述

设置主题

根据个人喜好配置主题,当前默认为ZSH_THEME=“robbyrussell”,这里修改为ys,也可以设置为随机random

#查看所有主题
ls .oh-my-zsh/themes

#编辑.zshrc文件配置主题
nano ~/.zshrc

#重新加载配置文件,使其生效
source ~/.zshrc

在这里插入图片描述

安装语法高亮插件

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

#github 不行,用gitee
git clone https://gitee.com/gloriaied/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

编辑 .zshrc 文件,定位到plugins,新增:zsh-syntax-highlighting

# 修改配置文件
nano ~/.zshrc

# 重新加载配置文件
source ~/.zshrc

在这里插入图片描述

安装输入命令行时自动补全

#github
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

#github 不行,用gitee
git clone https://gitee.com/gloriaied/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

编辑 .zshrc 文件,定位到plugins,新增:zsh-autosuggestions

# 修改配置文件
vim ~/.zshrc

# 重新加载配置文件
source ~/.zshrc

在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

失控的程序猿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值