
Debian12 安装 zsh 及 配置 Oh my zsh
环境
Debian 最小化安装环境
安装 ZSH
1 | apt install zsh git -y |
配置 oh-my-zsh
1 | # 官方 推荐! |
更改默认终端
如果使用官方推荐方式则跳过这一步
1 | chsh -s /usr/bin/zsh |
这时候打开终端软件,应该就会默认进入 zsh 了。
如果 shell 连接进入 bash 则需要重启一下系统
安装插件
快捷安装以下插件
1 | apt install zsh-syntax-highlighting zsh-autosuggestions autojump -y |
zsh-syntax-highlighting 命令高亮插件
1 | apt install zsh-syntax-highlighting -y |
zsh-autosuggestions 自动建议补全
1 | apt install zsh-autosuggestions -y |
安装 autojump 目录跳转
1 | apt install autojump -y |
插件配置
同样是打开.zshrc 文件,找到 plugins=(git),在这里增加自己想要的插件即可,多个插件名称之间使用空格或者换行分开(不能使用逗号)。vim ~/.zshrc
1 | ZSH_THEME="steeef" |
# 其他配置
.zshrc
1 | # 自动更新不需要确认 |
每次修改完 .zshrc 都需要
1 | source ~/.zshrc |
source /etc/profile
如果将 source /etc/profile
放入 .zshrc 中,会覆盖 zsh 的样式。因此,需要对代码进行修改。(也就是删除中间一段代码)
1 | root at feng in ~ |
推荐主题
默认 robbyrussell
简约 steeef
- Thanks for your appreciation. / 感谢您的赞赏
赞赏名单
Because of your support, I realize the value of writing articles. / 由于您的支持,我才能够实现写作的价值。
本文是原创文章,采用CC BY-NC-SA 4.0协议,完整转载请注明来自Go知行
评论