自定义oh-my-posh主题

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "console_title_template": "{{ if .Root }}Admin: {{ end }}{{ .PWD }}",
  "blocks": [
    {
      "segments": [
        {
          "foreground": "#00C5C7",
          "properties": {
            "style": "round",
            "threshold": 5000
          },
          "style": "diamond",
          "template": "{{ .FormattedMs }} ",
          "type": "executiontime"
        },
        {
          "foreground": "#00C5C7",
          "properties": {
            "time_format": "15:04:05"
          },
          "style": "plain",
          "template": "{{ .CurrentDate | date .Format }}",
          "type": "time"
        }
      ],
      "type": "rprompt"
    },
    {
      "alignment": "left",
      "segments": [
        {
          "foreground": "#77E4F7",
          "properties": {
            "style": "unique",
            "home_icon": "~"
          },
          "style": "plain",
          "template": "{{ if not .Writable }}\uf023 {{ end }}{{ .Path }} ",
          "type": "path"
        },
        {
          "foreground": "#FFE700",
          "style": "plain",
          "template": "{{ .HEAD }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }} ",
          "properties": {
            "fetch_stash_count": true,
            "fetch_status": true
          },
          "type": "git"
        },
        {
          "foreground": "#43D426",
          "foreground_templates": [
            "{{ if gt .Code 0 }}#f1184c{{ end }}"
          ],
          "style": "plain",
          "template": "\u276f ",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "version": 2
}
全部评论

相关推荐

点赞 评论 收藏
转发
点赞 收藏 评论
分享
牛客网
牛客企业服务