Skip to content

Instantly share code, notes, and snippets.

@Xiaorui-Huang
Last active September 4, 2024 20:08
Show Gist options
  • Select an option

  • Save Xiaorui-Huang/6cd85b890d2ff12b0a1fdee90e620204 to your computer and use it in GitHub Desktop.

Select an option

Save Xiaorui-Huang/6cd85b890d2ff12b0a1fdee90e620204 to your computer and use it in GitHub Desktop.
omp_config
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"auto_upgrade": true,
"disable_notice": true,
"blocks": [
{
"alignment": "right",
"segments": [
{
"background": "p:black",
"foreground": "p:error",
"leading_diamond": "\ue0b6",
"style": "diamond",
"template": "\uf00d {{ reason .Code }}:{{ .Code }}",
"trailing_diamond": "\ue0b4",
"type": "status"
},
{
"background": "p:black",
"foreground": "p:green_folder",
"leading_diamond": " \ue0b6",
"properties": {
"style": "folder"
},
"style": "diamond",
"template": "\ue5ff {{ .Path }}",
"trailing_diamond": "\ue0b4",
"type": "path"
},
{
"background": "p:black",
"foreground": "#43CCEA",
"foreground_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}",
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
"{{ if gt .Behind 0 }}#B388FF{{ end }}"
],
"leading_diamond": " \ue0b6",
"properties": {
"branch_max_length": 25,
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"style": "diamond",
"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 }} \uf692 {{ .StashCount }}{{ end }}",
"trailing_diamond": "\ue0b4",
"type": "git"
},
{
"background": "p:black",
"foreground": "#E4F34A",
"leading_diamond": " \ue0b6",
"properties": {
"fetch_version": false
},
"style": "diamond",
"template": "\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }}{{ end }}{{ .Full }}{{ end }}",
"trailing_diamond": "\ue0b4",
"type": "python"
},
{
"background": "p:black",
"foreground": "#CE422B",
"leading_diamond": " \ue0b6",
"properties": {
"fetch_version": false
},
"style": "diamond",
"template": "\ue7a8 Rust",
"trailing_diamond": "\ue0b4",
"type": "rust"
},
{
"background": "p:black",
"foreground": "#7FD5EA",
"leading_diamond": " \ue0b6",
"properties": {
"fetch_version": false
},
"style": "diamond",
"template": "\ufcd1{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}",
"trailing_diamond": "\ue0b4",
"type": "go"
},
{
"background": "p:black",
"foreground": "#42E66C",
"leading_diamond": " \ue0b6",
"properties": {
"fetch_version": false
},
"style": "diamond",
"template": "\ue718{{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}",
"trailing_diamond": "\ue0b4",
"type": "node"
},
{
"background": "p:black",
"foreground": "p:red",
"leading_diamond": " \ue0b6",
"properties": {
"fetch_version": false
},
"style": "diamond",
"template": "\ue738{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}",
"trailing_diamond": "\ue0b4",
"type": "java"
},
{
"background": "p:black",
"foreground": "p:purple",
"foreground_templates": [
"{{if eq \"Charging\" .State.String}}#40c4ff{{end}}",
"{{if eq \"Discharging\" .State.String}}#ff5722{{end}}",
"{{if eq \"Full\" .State.String}}#4caf50{{end}}"
],
"leading_diamond": " \ue0b6",
"properties": {
"charged_icon": "\uf240 ",
"charging_icon": "\u21e1 ",
"discharging_icon": "\u21e3 "
},
"style": "diamond",
"template": "{{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}",
"trailing_diamond": "\ue0b4",
"type": "battery"
},
{
"type": "os",
"style": "diamond",
"background": "p:black",
"foreground": "p:grey",
"leading_diamond": " \ue0b6",
"template": "{{ if .WSL }}WSL@{{ end }}{{.Icon}} {{.HostName}}",
"trailing_diamond": "\ue0b4"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"background": "p:black",
"foreground": "p:grey",
"properties": {
"mapped_shell_names": {
"pwsh": "<p:pwsh,>\uebc7 pwsh</>",
"bash": "<p:bash,>\uebca bash</>"
}
},
"style": "diamond",
"template": "{{ .Name }}",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\ue0b4 ",
"type": "shell"
},
{
"background": "p:black",
"foreground": "p:grey",
"leading_diamond": "\ue0b6",
"properties": {
"style": "austin",
"threshold": 150
},
"style": "diamond",
"template": "{{ .FormattedMs }}",
"trailing_diamond": "\ue0b4 ",
"type": "executiontime"
},
{
"background": "p:black",
"foreground": "p:red",
"leading_diamond": "\ue0b6",
"style": "diamond",
"template": "{{ if .SSHSession }} {{ end }}{{ .UserName }} \u276f",
"trailing_diamond": "\ue0b4",
"type": "session"
}
],
"type": "prompt"
}
],
"transient_prompt": {
"foreground": "p:red",
"background": "transparent",
"template": "<p:black,transparent>\ue0b6</><p:green_folder,p:black>{{ .Folder }}</><p:black,transparent>\ue0b4</> {{if .Segments.Contains \"Executiontime\"}}<p:black,transparent>\ue0b6</><p:grey,p:black>{{ .Segments.Executiontime.FormattedMs }}</><p:black,transparent>\ue0b4</> {{end}}{{if .Segments.Contains \"Exit\"}}<p:black,transparent>\ue0b6</><p:error,p:black>{{.Segments.Exit.Meaning}}:{{.Code}}</><p:black,transparent>\ue0b4</> {{end}}"
},
"secondary_prompt": {
"foreground": "p:black",
"background": "transparent",
"template": "<p:black,transparent>\ue0b6</><p:red,p:black> \u276f</><p:black,transparent>\ue0b4</> "
},
"palette": {
"black": "#29315A",
"red": "#E64747",
"grey": "#AEA4BF",
"purple": "#9B6BDF",
"error": "#FF0000",
"green_folder": "#3EC669",
"pwsh": "#086EBE",
"bash": "#4BA324"
},
"final_space": true,
"version": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment