已经忘了为啥不用 ohmyzsh 了,反正就是用上了 starship, 目前体验还可以
➜ cat ~/.config/starship.toml
# 整体格式排版:主机名 -> 目录 -> Git状态 -> Kubernetes上下文 -> 换行输入
format = """
$hostname\
$directory\
$git_branch\
$git_status\
$kubernetes\
$line_break\
$character"""
add_newline = true
[hostname]
ssh_only = false
format = "[mc]($style) "
style = "bold cyan"
# 极简的目录显示
[directory]
truncation_length = 3
truncate_to_repo = false
# 命令提示符箭头
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[✗](bold red)"
[package]
disabled = true
[git_branch]
# 1. 清空默认的图标符号(解决乱码问题)
symbol = ""
# 2. 重写输出格式,只保留分支名称本身,去掉自带的 "on " 等冗余文本
format = "[$branch]($style) "
# 3. 沿用之前选好的护眼十六进制色号(例如冰蓝色)
style = "bold #8aadf4"
[git_status]
# 1. 重写格式:去掉所有冗余的前缀和后缀,只保留状态统计
format = '([\[$all_status$ahead_behind\]]($style) )'
style = "bold #f5a97f" # 使用柔和的橙色,提醒有代码变动
# 2. 将所有复杂的图标替换为最直观的文本或基础符号
# 这里的配置思想是:如果没有变动,则不显示;有变动则显示简洁标识
conflicted = "冲突 "
ahead = "↑"
behind = "↓"
diverged = "↕"
up_to_date = ""
untracked = "?"
stashed = "$"
modified = "!"
staged = "+"
renamed = "»"
deleted = "-"
[kubernetes]
disabled = false
# 格式:[集群名]
format = '([$context]($style) )'
style = "dim #c6a0f6" # 淡淡的紫色,低调但可见
mc ~/g/kube-ovn master