侧边栏壁纸
博主昵称
流苏小筑

步伐虽小,密而不止

使用zsh和zim美化shell

2022年09月10日 360阅读 0评论 1点赞

使用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

按着步骤设置即可

1

—— 评论区 ——

昵称
邮箱
网址
取消