Skip to content

Instantly share code, notes, and snippets.

@glektarssza
Created February 12, 2025 04:38
Show Gist options
  • Save glektarssza/93969ef874f87feb679e16a1763a2fba to your computer and use it in GitHub Desktop.
Save glektarssza/93969ef874f87feb679e16a1763a2fba to your computer and use it in GitHub Desktop.
Oh My Posh Configuration
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title_template": "{{.UserName}}@{{.HostName}} {{.Shell}} in {{.PWD}}",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "session",
"style": "powerline",
"foreground": "#000000",
"background": "#c386f1",
"leading_powerline_symbol": "",
"powerline_symbol": "",
"template": "{{ if .SSHSession }} {{ end }}snek@{{ .HostName }}"
},
{
"type": "time",
"style": "powerline",
"foreground": "#38ff14",
"background": "#1a2f33",
"powerline_symbol": "",
"leading_powerline_symbol": "",
"template": "  {{ .CurrentDate | date .Format }} ",
"properties": {
"time_format": "3:04 PM"
}
},
{
"type": "root",
"style": "powerline",
"foreground": "#111111",
"background": "#ffff66",
"powerline_symbol": "",
"leading_powerline_symbol": "",
"template": "  "
},
{
"type": "path",
"style": "powerline",
"foreground": "#000000",
"background": "#ff94c6",
"powerline_symbol": "",
"leading_powerline_symbol": "",
"template": "  {{.Path}} ",
"properties": {
"style": "folder",
"folder_separator_icon": "/",
"mapped_locations_enabled": true,
"mapped_locations": {}
}
},
{
"type": "node",
"style": "powerline",
"foreground": "#000000",
"background": "#90c186",
"powerline_symbol": "",
"leading_powerline_symbol": "",
"template": " {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
"properties": {
"display_mode": "context",
"fetch_package_manager": true,
"fetch_version": true,
"home_enabled": false,
"missing_command_text": ""
}
},
{
"type": "git",
"style": "powerline",
"foreground": "#112a46",
"background": "#D6D6D6",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb3b{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ffcc80{{ end }}",
"{{ if gt .Ahead 0 }}#b388ff{{ end }}",
"{{ if gt .Behind 0 }}#b388fb{{ end }}"
],
"powerline_symbol": "",
"leading_powerline_symbol": "",
"template": " {{ .UpstreamIcon }}{{ $head := dict list }}{{ $head := .HEAD | splitList \"\" | first | set $head \"symbol\" }}{{ $head := .HEAD | splitList \"\" | rest | join \"\" | set $head \"rest\" }}{{ values $head | sortAlpha | reverse | join \" \" }}{{ if .BranchStatus }}{{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }}  {{ .StashCount }}{{ end }} ",
"properties": {
"fetch_status": true,
"fetch_upstream_icon": false,
"fetch_user": false,
"fetch_worktree_count": false,
"fetch_bare_info": false,
"fetch_stash_count": false
}
},
{
"type": "shell",
"style": "powerline",
"foreground": "#ffffff",
"background": "#004570",
"powerline_symbol": "",
"leading_powerline_symbol": "",
"template": "  {{ .Name }} "
},
{
"type": "status",
"style": "powerline",
"foreground": "#000000",
"background": "#4ac5c9",
"background_templates": [
"{{ if gt .Code 0 }}#F599B8{{ end }}"
],
"powerline_symbol": "",
"leading_powerline_symbol": "",
"template": "{{ if gt .Code 0 }}  {{ .Meaning }} {{ else }}  {{ end }}",
"properties": {
"always_enabled": true
}
}
]
},
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"template": " > ",
"foreground": "#ffffff",
"type": "text",
"style": "plain"
}
],
"newline": true
}
],
"version": 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment