oh-my-posh/website/docs/configuration/example.md

97 lines
2.5 KiB
Markdown
Raw Normal View History

---
2022-04-20 09:43:59 -07:00
id: sample
title: Sample
sidebar_label: Sample
---
```json
{
2022-02-02 10:38:31 -08:00
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "right",
"segments": [
{
"foreground": "#007ACC",
2022-03-27 01:12:47 -07:00
"template": " {{ .CurrentDate | date .Format }} ",
"properties": {
"time_format": "15:04:05"
2022-02-02 10:38:31 -08:00
},
"style": "plain",
"type": "time"
}
2022-02-02 10:38:31 -08:00
],
"type": "prompt",
"vertical_offset": -1
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"background": "#ffb300",
2022-02-02 10:38:31 -08:00
"foreground": "#ffffff",
"leading_diamond": "\ue0b6",
2022-03-27 01:12:47 -07:00
"template": " {{ .UserName }} ",
2022-02-02 10:38:31 -08:00
"style": "diamond",
"trailing_diamond": "\ue0b0",
"type": "session"
},
{
"background": "#61AFEF",
2022-02-02 10:38:31 -08:00
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
2022-03-27 01:12:47 -07:00
"template": " {{ .Path }} ",
"properties": {
"exclude_folders": [
"/super/secret/project"
2022-02-02 10:38:31 -08:00
],
2022-03-27 01:12:47 -07:00
"style": "folder"
2022-02-02 10:38:31 -08:00
},
"style": "powerline",
"type": "path"
},
{
"background": "#2e9599",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#f36943{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#a8216b{{ end }}",
"{{ if gt .Ahead 0 }}#35b5ff{{ end }}",
"{{ if gt .Behind 0 }}#f89cfa{{ end }}"
],
2022-02-02 10:38:31 -08:00
"foreground": "#193549",
"foreground_templates": [
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ffffff{{ end }}"
],
"powerline_symbol": "\ue0b0",
2022-03-27 01:12:47 -07:00
"template": " {{ .HEAD }}{{ .BranchStatus }} ",
"properties": {
"branch_max_length": 25,
2022-03-27 01:12:47 -07:00
"fetch_status": true
2022-02-02 10:38:31 -08:00
},
"style": "powerline",
"type": "git"
},
{
"background": "#00897b",
2022-02-02 10:38:31 -08:00
"background_templates": [
"{{ if gt .Code 0 }}#e91e63{{ end }}"
],
"foreground": "#ffffff",
2022-03-27 01:12:47 -07:00
"template": "<parentBackground>\ue0b0</> \ue23a ",
"properties": {
2022-03-27 01:12:47 -07:00
"always_enabled": true
2022-02-02 10:38:31 -08:00
},
"style": "diamond",
"trailing_diamond": "\ue0b4",
"type": "exit"
}
2022-02-02 10:38:31 -08:00
],
"type": "prompt"
}
2022-02-02 10:38:31 -08:00
],
"final_space": true,
2022-03-27 01:12:47 -07:00
"version": 2
}
```