一、Oh My Zsh 安装与配置
# 安装 Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 安装推荐插件
# zsh-autosuggestions: 命令自动补全(灰色提示)
git clone https://github.com/zsh-users/zsh-autosuggestions \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# zsh-syntax-highlighting: 语法高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 编辑 .zshrc 启用插件
# plugins=(git docker docker-compose node npm
# zsh-autosuggestions zsh-syntax-highlighting)
二、Starship 跨平台提示符
# 安装
curl -sS https://starship.rs/install.sh | sh
# 在 ~/.zshrc 末尾添加
eval "$(starship init zsh)"
# ~/.config/starship.toml
format = """
[](#9A348E)\
$os\
$username\
[](bg:#DA627D fg:#9A348E)\
$directory\
[](fg:#DA627D bg:#FCA17D)\
$git_branch\
$git_status\
[](fg:#FCA17D bg:#86BBD8)\
$nodejs\
$docker_context\
[](fg:#86BBD8)\
$character
"""
[directory]
truncation_length = 3
truncate_to_repo = false
[git_branch]
format = "[$branch]($style)"
style = "bold white"
[nodejs]
format = "[⬢ $version](bold green)"
[character]
success_symbol = "[❯](bold green)"
error_symbol = "[❯](bold red)"
三、Tmux 终端复用器
# ~/.tmux.conf
# 修改前缀键为 Ctrl+a
set -g prefix C-a
unbind C-b
# 鼠标支持
set -g mouse on
# 分屏快捷键
bind | split-window -h # 水平分屏
bind - split-window -v # 垂直分屏
# 窗口导航
bind -r j select-pane -D
bind -r k select-pane -U
bind -r h select-pane -L
bind -r l select-pane -R
💡 推荐主题:Starship 预设用 pastel-powerline;终端配色用 catppuccin 或 tokyo-night;字体用 JetBrains Mono Nerd Font(含图标)。