[{"content":"你好,我是fff-star,目前是大二本科生，当前感兴趣的方向为密码学，编码理论，数学。\n","date":null,"permalink":"https://fff-star.pages.dev/zh-hans/","section":"","summary":"","title":""},{"content":"这里将会存放我的一些技术的文档，以下是我使用过的部分软件：\n编辑器：Zed,Neovim(vim) 音乐播放器： MPD,MPC,ncmpcpp Shell: zsh (使用zimfw作为插件管理器) ","date":null,"permalink":"https://fff-star.pages.dev/zh-hans/docs/","section":"","summary":"","title":""},{"content":"准备工作 #选择一个终端模拟器 #虽然终端模拟器和shell并没有什么关系，但是选择一个适合你的终端模拟器可以极大的提升你shell的使用体验。在Window平台,我认为最值得推荐的就是微软的Windows Terminal,需要特别注意的是，这篇文章主要是写给Linux,同时macOS也可以参照这个教程，如果你想要在Windows学习和使用shell,我认为最好的选择可能会是使用WSL。\n在linux和mac下有许多好用的终端模拟器。这些在功能上很多都是大同小异，你可以根据你的喜好和使用的习惯选择一个适合你的终端模拟器。 个人认为比较推荐的终端模拟器主要有:ghostty,kitty,alacritty,foot,下面是简单的对比:\nterminal emulator ghostty kitty alacritty foot 优点 较好的默认设置，GPU加速,协议支持好 特性丰富，GPU加速 全平台，快速，GPU加速 wayland原生，内存占用小 缺点 相对较新，还在发展中 配置文件较复杂 特性少，需依赖其他工具 功能相对简单 平台 macos,linux macos,linux windows,linux,macos linux(wayland) 选择一款字体 #为了实现漂亮的终端环境，普通的字体显然是无法满足我们的需求。现在主流推荐是使用nerd font，可以自行搜索下载你喜欢的字体。\n配置shell #shell 的类型 #在2026年，大家主要是用的终端类型主要有bash，zsh，fish。你需要选择一个shell，下面是一些基本的对比。\n特性 Bash Zsh Fish 自动建议 无 插件 内置 语法高亮 无 插件 内置 tab补全 基础 插件的体验较好 开箱即用 POSIX 兼容性 兼容 几乎完全兼容 不兼容 可以看出Fish的开箱即用，特性丰富，但是没有POSIX兼容；Bash是POSIX兼容的shell，但是缺少很多的特性；Zsh几乎兼容所有的POSIX,同时可以使用插件实现许多特性，但是需要一定的配置。\n这三者之间没有什么绝对的选择，你可以根据你的使用习惯和使用环境选择一个shell，本篇接下来的部分主要是配置Zsh，如果你选择其他的可以参考其他资料。\n下载Zsh并设置为默认shell # 你遇到的任何问题，我推荐询问llm来解决 使用合适的包管理器，下载zsh，以fedora为例：\nsudo dnf install zsh 下载好zsh后，将默认shell设置为zsh:\nchsh -s $(which zsh) 通常需要先将zsh的路径添加至/etc/shells 选择一个插件管理器 #正如前文所述，zsh需要一定插件来提升使用体验，zsh最有名的插件管理器无疑是Oh My Zsh,但我认为这个框架比较重，我会更推荐使用zimfw,使用如下命令安装:\ncurl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh 现在只需要维护两个文件.zshrc和.zimrc，前者是你使用zsh之前运行的代码，后者是你所有使用的插件,默认的zimfw已经给你配置了许多的许多好用的插件了，你可以根据你的使用体验添加和删除这些插件\n下面是我的.zimrc:\n# Start configuration added by Zim Framework install {{{ # # This is not sourced during shell startup and is only used to configure zimfw. # # # Modules # # Sets sane Zsh built-in environment options. zmodule environment # Provides handy git aliases and functions. zmodule git # Applies correct bindkeys for input events. zmodule input # Sets a custom terminal title. zmodule termtitle # Utility aliases and functions. Adds colour to ls, grep and less. zmodule utility # # Prompt zmodule romkatv/powerlevel10k # # Exposes how long the last command took to run to prompts. zmodule duration-info # Exposes git repository status information to prompts. zmodule git-info # # Completion # # Additional completion definitions for Zsh. zmodule zsh-users/zsh-completions --fpath src # Enables and configures smart and extensive tab completion, must be sourced # after all modules that add completion definitions. zmodule completion # # Modules that must be initialized last # # Fish-like syntax highlighting for Zsh, must be sourced after completion. zmodule zdharma-continuum/fast-syntax-highlighting # Fish-like history search for Zsh, must be sourced after zsh-users/zsh-syntax-highlighting. zmodule zsh-users/zsh-history-substring-search # Fish-like autosuggestions for Zsh. zmodule zsh-users/zsh-autosuggestions # }}} End configuration added by Zim Framework install # Fzf-plugins to enhance tab completion and fuzzy finding. zmodule Aloxaf/fzf-tab zimfw具体使用，请使用以下命令查看:\nzimfw --help 结语 #通过上述步骤，你已经成功配置了一个功能强大且高度可定制的Zsh环境。\n","date":null,"permalink":"https://fff-star.pages.dev/zh-hans/docs/shell/","section":"","summary":"","title":"从0配置命令行环境"},{"content":"","date":null,"permalink":"https://fff-star.pages.dev/zh-hans/categories/","section":"Categories","summary":"","title":"Categories"},{"content":"","date":null,"permalink":"https://fff-star.pages.dev/zh-hans/tags/","section":"Tags","summary":"","title":"Tags"}]