Skip to content

Instantly share code, notes, and snippets.

@GhostOps77
Last active January 28, 2024 15:19
Show Gist options
  • Save GhostOps77/62c0517f629cabec9d9b0077bdefbf4d to your computer and use it in GitHub Desktop.
Save GhostOps77/62c0517f629cabec9d9b0077bdefbf4d to your computer and use it in GitHub Desktop.
My oh-my-posh config
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"var": {
"shell_icons": {
"pwsh": "",
"cmd": "",
"bash": "",
"zsh": "%_",
"fish": "<red><</><orange>></><yellow><</>"
}
},
"blocks": [
{
"type": "prompt",
"alignment": "left",
"newline": true,
"segments": [
{
"type": "text",
"style": "plain",
"template": "╭─"
},
{
"type": "os",
"style": "plain",
"foreground_templates": [
"{{ if eq .Icon \"\" }}#e95420{{ end }}",
"{{ if eq .Icon \"\" }}#f00{{ end }}",
"{{ if eq .Icon \"\" }}#5076a7{{ end }}",
"#4d4d4d"
],
"template": "{{ if .WSL }}<#fff>[</>{{ .Icon }} wsl<#fff>]</>{{ end }}"
},
{
"type": "session",
"style": "plain",
"template": "{{ if ne .OS \"windows\"}}[{{ if .SSHSession }}<#8710e0> </>{{ end }}<#3b67ff>{{ .UserName }}<#fff>@</>{{ .HostName }}</>]{{ end }}"
},
{
"type": "path",
"style": "plain",
"template": "[{{ if not .Writable }}<#ebd61a> </>{{ end }}<#3eb715>{{ $git := .Segments.Git }}{{ if $git.Dir }} <b>{{ path $git.RepoName $git.Dir }}</b>{{ if ne $git.RepoName .Path}}{{ $trimmedpath := (trimPrefix $git.Dir .PWD) }}{{ if $trimmedpath }}{{ path $trimmedpath .Location }}{{ end }}{{ end }}{{ else }} {{ path .Path .Location }}{{ end }}</>]",
"properties": {
"max_depth": 12,
"style": "agnoster_short",
"mapped_locations": {
"H:\\mouhsen\\F\\VS Code": "<#0078d7>󰨞</>",
"/mnt/c/": "<#00adef>:</>C",
"/mnt/d/": "<#00adef>:</>D",
"/mnt/e/": "<#00adef>:</>E",
"/mnt/f/": "<#00adef>:</>F",
"/mnt/g/": "<#00adef>:</>G",
"/mnt/h/": "<#00adef>:</>H",
"/mnt/i/": "<#00adef>:</>I",
"/mnt/j/": "<#00adef>:</>J"
}
}
},
{
"type": "git",
"style": "plain",
"min_width": 90,
"template": "[<#f14e32>{{ url .UpstreamIcon .UpstreamURL }} {{ .HEAD }}</>]",
"properties": {
"fetch_upstream_icon": true,
"branch_max_length": 25,
"git_icon": "",
"github_icon": ""
}
},
{
"type": "docker",
"style": "plain",
"min_width": 100,
"template": "{{if .Context}}[<#0B59E7> {{ .Context }}</>]{{end}}"
},
{
"type": "python",
"style": "plain",
"min_width": 110,
"template": "[<#ffde57> {{ if .Error }}{{ .Error }}{{ else }}v{{ .Full }}{{ if .Venv }} ({{ .Venv }}){{ end }}{{ end }}</>]"
},
{
"type": "text",
"style": "plain",
"template": "\n╰─"
},
{
"type": "shell",
"style": "plain",
"foreground_templates": [
"{{ if eq .Name \"pwsh\" }}#0077c2{{ end }}",
"{{ if eq .Name \"bash\" }}#c2c2c0{{ end }}",
"{{ if eq .Name \"cmd\" }}#c2c2c0{{ end }}",
"{{ if eq .Name \"zsh\" }}#e95420{{ end }}"
],
"template": "<#fff>[</>{{ if .Root }}<#f00></> {{ end }}{{ get .Var.shell_icons .Name }}{{ if not (hasKey .Var.shell_icons .Name)}}.Name{{ end }}<#fff>]</>"
},
{
"type": "executiontime",
"style": "plain",
"foreground": "#8800dd",
"template": "  {{ .FormattedMs }} ",
"properties": {
"threshold": 0,
"style": "austin",
"always_enabled": true
}
},
{
"type": "status",
"style": "plain",
"foreground_templates": [
"{{ if gt .Code 0 }}#f1184c{{ end }}"
],
"template": "",
"properties": {
"always_enabled": true
}
}
]
}
],
"secondary_prompt": {
"background": "transparent",
"foreground": "#fff",
"template": " "
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment