Finally got around to customising my OhMyPosh setup. I was using JanDeDobbeleer’s theme before, but it had way more info than I needed, making the prompt too cluttered.
Here’s my simplified version:
- Current directory (limited to two levels)
- Git branch and status
- Time of the command
- A finishing touch with an eggplant emoji
I also adjusted the colours to improve readability, though I might tweak them some more later.
My ohmyposh file…
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"console_title_template": "{{.UserName}}@{{.HostName}} in {{ .PWD }}",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "path",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#fff",
"background": "#0C374D",
"template": " \ue5ff {{ .Path }} ",
"properties": {
"folder_separator_icon": "/",
"max_depth": 2,
"style": "agnoster_short"
}
},
{
"type": "git",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#10212E",
"background": "#9BD6C4",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#EA9B20{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#E0B2A7{{ end }}",
"{{ if gt .Ahead 0 }}#AAC8EB{{ end }}",
"{{ if gt .Behind 0 }}#E0B2A7{{ end }}"
],
"leading_diamond": "\ue0b6",
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
}
},
{
"type": "time",
"style": "diamond",
"foreground": "#fff",
"background": "#0C374D",
"trailing_diamond": "\ue0b4",
"template": "<#fff> \ue641 </>{{ .CurrentDate | date .Format }} "
}
]
},
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "root",
"style": "plain",
"foreground": "#fff",
"template": " ⚡ "
},
{
"type": "text",
"style": "plain",
"foreground": "#f1184c",
"template": "🍆 "
}
]
}
]
}