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

95 lines
2.6 KiB
Plaintext
Raw Normal View History

---
2022-04-20 09:43:59 -07:00
id: sample
title: Sample
sidebar_label: Sample
---
import Config from "@site/src/components/Config.js";
2022-06-03 13:35:11 -07:00
<Config
data={{
$schema:
"https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
blocks: [
{
segments: [
{
foreground: "#007ACC",
template: " {{ .CurrentDate | date .Format }} ",
properties: {
time_format: "15:04:05",
},
style: "plain",
type: "time",
2022-02-02 10:38:31 -08:00
},
],
type: "rprompt",
},
{
alignment: "left",
newline: true,
segments: [
{
background: "#ffb300",
foreground: "#ffffff",
leading_diamond: "\ue0b6",
template: " {{ .UserName }} ",
style: "diamond",
trailing_diamond: "\ue0b0",
type: "session",
2022-02-02 10:38:31 -08:00
},
{
background: "#61AFEF",
foreground: "#ffffff",
powerline_symbol: "\ue0b0",
template: " {{ .Path }} ",
properties: {
style: "folder",
},
exclude_folders: ["/super/secret/project"],
style: "powerline",
type: "path",
2022-02-02 10:38:31 -08:00
},
{
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 }}",
],
foreground: "#193549",
foreground_templates: [
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ffffff{{ end }}",
],
powerline_symbol: "\ue0b0",
template:
" {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }} ",
properties: {
branch_max_length: 25,
fetch_status: true,
},
style: "powerline",
type: "git",
2022-02-02 10:38:31 -08:00
},
{
background: "#00897b",
background_templates: ["{{ if gt .Code 0 }}#e91e63{{ end }}"],
foreground: "#ffffff",
template: "<parentBackground>\ue0b0</> \ue23a ",
properties: {
always_enabled: true,
},
style: "diamond",
trailing_diamond: "\ue0b4",
type: "status",
},
],
type: "prompt",
},
],
final_space: true,
version: 2,
}}
/>