Skip to content

Instantly share code, notes, and snippets.

@ardalis
Last active December 19, 2025 20:50
Show Gist options
  • Select an option

  • Save ardalis/60c5d900d30d30980fef084128b50da6 to your computer and use it in GitHub Desktop.

Select an option

Save ardalis/60c5d900d30d30980fef084128b50da6 to your computer and use it in GitHub Desktop.
oh-my-posh theme ardalis
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title": true,
"console_title_style": "template",
"console_title_template": "{{ .Folder }} ({{ .Shell }}{{ if .Root }} - ⚡ADMIN⚡{{ end }})",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"leading_diamond": "\ue0b6",
"trailing_diamond": "\ue0c6",
"template": "\ue86c {{ if .Root }}⚡ {{ end }}",
"foreground": "#fff",
"background": "#E36464",
"type": "shell",
"style": "diamond"
},
{
"properties": {
"folder_depth": 2,
"style": "agnoster_short"
},
"leading_diamond": "\ue0c7",
"trailing_diamond": "\ue0c6",
"template": " {{ .Path }} ",
"foreground": "#fff",
"background": "green",
"type": "path",
"style": "diamond"
},
{
"properties": {
"branch_icon": ""
},
"leading_diamond": "\ue0c7",
"trailing_diamond": "\ue0c6",
"template": " git({{ .HEAD }}) ",
"foreground": "#fff",
"background": "lightCyan",
"type": "git",
"style": "diamond"
},
{
"properties": {
"time_format": "15:04"
},
"leading_diamond": "\ue0c7",
"trailing_diamond": "\ue0c6",
"template": " {{ .CurrentDate | date .Format }} ",
"foreground": "#fff",
"background": "lightMagenta",
"type": "time",
"style": "diamond"
}
]
}
],
"version": 3,
"final_space": true
}
@ardalis
Copy link
Author

ardalis commented Dec 9, 2025

Current $PROFILE:

oh-my-posh init pwsh --config "https://gist.githubusercontent.com/ardalis/60c5d900d30d30980fef084128b50da6/raw/76ae1c8993c56299d1184f5008f1262dc067d885/ardalis.omp.json" | Invoke-Expression

# Chocolatey profile (unchanged)
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
  Import-Module "$ChocolateyProfile"
}

# Remove the built-in cd alias so our function takes over
if (Test-Path alias:cd) {
    Remove-Item alias:cd
}

# Enable using 'cd -' to return to previous location
function cd {
    param([string]$path = $HOME)

    if ($path -eq '-') {
        if ($global:OLDPWD) {
            $tmp = $PWD.Path
            Set-Location $global:OLDPWD
            $global:OLDPWD = $tmp
        } else {
            Write-Host "No previous directory found."
        }
        return
    }

    $global:OLDPWD = $PWD.Path

    if (Test-Path $path -PathType Container) {
        Set-Location $path
    }
    else {
        Write-Host "cd: path not found: $path"
    }
}

# Only jump to C:\dev if we started in our home folder
if ($PWD.Path -ieq $HOME) {
    cd "C:\dev"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment