侧边栏壁纸
博主头像
流苏小筑 博主等级

行动起来,活在当下

  • 累计撰写 139 篇文章
  • 累计创建 57 个标签
  • 累计收到 9 条评论

目 录CONTENT

文章目录

使用zsh和zim美化shell

Administrator
2022-09-10 / 0 评论 / 0 点赞 / 1 阅读 / 0 字

使用zsh和zim美化shell

Zsh 搭配 Oh-My-Zsh 虽然功能强大,但是我不需要那么多复杂的功能,所以选择Zimfw ,相比于 Oh-My-Zsh,它加载和执行速度更快,减少了等待时间。

查看系统当前使用的 shell

echo $SHELL

安装 zsh

apt install zsh -y

查看系统自带shell

cat /etc/shells

设置 zsh 设为默认 shell

chsh -s /bin/zsh
reboot

安装 zim
GItHub地址https://github.com/zimfw/zimfw

curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
或
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh

修改配置文件

vim ~/.zimrc
# ~/.zimrc
# 使用 degit 加速插件安装
zstyle ':zim:zmodule' use 'degit'

# ----------------------------
# 核心功能模块
# ----------------------------
zmodule input                      # 增强键盘映射 (Home/End 等)
zmodule utility                    # 命令别名及颜色配置
zmodule termtitle                  # 动态终端标题

# ----------------------------
# 开发工具插件
# ----------------------------
zmodule zsh-users/zsh-completions --fpath src  # 补全增强
zmodule zsh-users/zsh-autosuggestions         # 自动建议(必须在语法高亮前加载)
zmodule z-shell/F-Sy-H                        # 语法高亮(必须最后加载)
zmodule zsh-users/zsh-history-substring-search # 历史搜索

# ----------------------------
# 实用工具
# ----------------------------
zmodule ohmyzsh/ohmyzsh --root plugins/sudo    # 双击 ESC 添加 sudo
zmodule git-info                               # Git 状态提示
zmodule duration-info                         # 命令耗时统计

# ----------------------------
# 主题系统
# ----------------------------
zmodule romkatv/powerlevel10k --use degit      # Powerlevel10k 主题

安装插件

# 安装
zimfw install
# 配置主题
p10k configure

按着步骤设置即可

0

评论区