Skip to content

Instantly share code, notes, and snippets.

@panicoenlaxbox
Last active December 29, 2021 12:02
Show Gist options
  • Save panicoenlaxbox/333245651df7e4262cccd3ac7cceaa50 to your computer and use it in GitHub Desktop.
Save panicoenlaxbox/333245651df7e4262cccd3ac7cceaa50 to your computer and use it in GitHub Desktop.
oh-my-posh with my personal preferences (dotnet & python)
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"final_space": true,
"osc99": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "path",
"style": "diamond",
"foreground": "black",
"background": "lightBlue",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\ue0b0",
"properties": {
"prefix": " \ue5ff ",
"style": "folder"
}
},
{
"type": "git",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#193549",
"background": "#fffb38"
},
{
"type": "dotnet",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#000000",
"background": "#00ffff",
"properties": {
"prefix": " \ue70c "
}
},
{
"type": "python",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#000000",
"background": "#00ffff",
"properties": {
"prefix": " \ue235 ",
"display_mode": "environment"
}
}
]
}
]
}
@panicoenlaxbox
Copy link
Author

With code $PROFILE you can edit your PS profile:

# function Prompt() {
#     $prompt = "PS "
#     if ($env:PIPENV_ACTIVE -eq 1 -or $env:POETRY_ACTIVE -eq 1) {
#         $prompt = "(" + (($env:VIRTUAL_ENV -split "\\")[-1] -split "-")[0] + ") "
#     }      
#     $prompt += $pwd.Path
#     Write-Host $prompt -NoNewline
#     "> "
# }

# https://docs.microsoft.com/es-es/windows/terminal/tutorials/custom-prompt-setup
Import-Module oh-my-posh
Set-PoshPrompt -Theme hotstick.minimal
Import-Module -Name Terminal-Icons
Import-Module posh-git

@panicoenlaxbox
Copy link
Author

You have to create a file named panicoenlaxbox.omp.json in %USERPROFILE%Documents\PowerShell\Modules\oh-my-posh\6.1.0\themes and execute Set-PoshPrompt -Theme panicoenlaxbox, anyway you can preview changes with Get-PoshThemes

@panicoenlaxbox
Copy link
Author

It has been useful for me to use this extension to convert from/to unicode character with the CaskaydiaCove NF font https://marketplace.visualstudio.com/items?itemName=cwan.native-ascii-converter

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