Ubuntu 终端配置指南

配置日期:2026-01-30 系统:Ubuntu 24.04 LTS 适用于:Debian/Ubuntu 系列 目录 Zsh + Oh-My-Zsh Powerlevel10k 主题 MesloLGS NF 字体 lsd 文件图标工具 Homebrew 包管理器 配置同步到其他用户 完整 .zshrc 配置 1. Zsh + Oh-My-Zsh Zsh 是功能更强大的 shell,Oh-My-Zsh 是 Zsh 的配置框架,提供主题和插件管理。 1.1 安装 Zsh sudo apt update sudo apt install -y zsh git curl wget fontconfig 1.2 安装 Oh-My-Zsh # 非交互模式安装 sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended 1.3 安装常用插件 # zsh-syntax-highlighting - 命令语法高亮(正确绿色,错误红色) git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting # zsh-autosuggestions - 根据历史记录自动补全命令(灰色提示,按→采纳) git clone https://github.com/zsh-users/zsh-autosuggestions \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions 1.4 设置 Zsh 为默认 Shell chsh -s $(which zsh) 2. Powerlevel10k 主题 Powerlevel10k 是高度可定制的 Zsh 主题,支持 Git 状态、命令执行时间等信息显示。 ...

January 30, 2026 · 4 min · Paolo