Skip to content

Instantly share code, notes, and snippets.

@rbrunt
Created August 7, 2024 16:04
Show Gist options
  • Save rbrunt/233b5b2d9772d3d5bc02d57900b806b0 to your computer and use it in GitHub Desktop.
Save rbrunt/233b5b2d9772d3d5bc02d57900b806b0 to your computer and use it in GitHub Desktop.
Oh My Posh Config
#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version = 2
console_title_template = '{{ .Folder }}'
[[blocks]]
type = 'prompt'
alignment = 'left'
[[blocks.segments]]
type = 'session'
style = 'diamond'
powerline_symbol = ''
foreground = 'transparent'
background = 'cyan'
leading_diamond = ''
template = '{{ .UserName }}{{ if .SSHSession }}@{{ .HostName }}{{ end }} '
[[blocks.segments]]
type = 'path'
style = 'powerline'
powerline_symbol = ''
foreground = 'transparent'
background = 'blue'
template = ' {{ .Path }} '
[blocks.segments.properties]
style = 'full'
[blocks.segments.properties.mapped_locations]
"C:\\src" = "src"
[[blocks.segments]]
type = "git"
style = "powerline"
powerline_symbol = ""
foreground = "transparent"
background = "green"
background_templates = [
"{{ if or (.Working.Changed) (.Staging.Changed) }}yellow{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}yellow{{ end }}",
"{{ if gt .Ahead 0 }}magenta{{ end }}",
"{{ if gt .Behind 0 }}magenta{{ end }}"
]
template = " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }} "
[blocks.segments.properties]
fetch_status = true
fetch_upstream_icon = false
full_branch_path = false
source = "cli"
[blocks.segments.properties.mapped_branches]
"feat/*" = "🚀 "
"bug/*" = "🐛 "
[[blocks]]
type = 'prompt'
alignment = 'right'
overflow = 'hide'
[[blocks.segments]]
type = "react"
style = "plain"
powerline_symbol = ""
foreground = "blue"
template = " {{ .Major }}.{{ .Minor }}"
[[blocks.segments]]
type = "python"
style = "plain"
powerline_symbol = ""
foreground = "green"
template = " {{ .Full }}"
[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true
[[blocks.segments]]
type = 'root'
style = 'plain'
foreground = 'red'
template = ' '
[[blocks.segments]]
type = 'text'
style = 'plain'
foreground = 'white'
template = ' '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment