Skip to content

Instantly share code, notes, and snippets.

@pcostarg
Last active September 15, 2022 16:14
Show Gist options
  • Select an option

  • Save pcostarg/c193b2cfc7587386e52e7ba9baf95b6d to your computer and use it in GitHub Desktop.

Select an option

Save pcostarg/c193b2cfc7587386e52e7ba9baf95b6d to your computer and use it in GitHub Desktop.

Revisions

  1. pcostarg revised this gist Sep 15, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion $Profile.ps1
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,6 @@ Import-Module -Name Terminal-Icons
    $env:POSH_GIT_ENABLED = $true
    Import-Module posh-git

    oh-my-posh --init --shell pwsh --config %LocalAppData%\Programs\oh-my-posh\themes\_ohmyposh-v1.omp.json | Invoke-Expression
    oh-my-posh --init --shell pwsh --config "%LocalAppData%\Programs\oh-my-posh\themes\_ohmyposh-v1.omp.json" | Invoke-Expression #needs literal path, replace %LocalAppData%

    Enable-PoshTransientPrompt
  2. pcostarg revised this gist Sep 15, 2022. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Modules-Install.ps1
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    winget install JanDeDobbeleer.OhMyPosh
    Install-Module posh-git -Scope CurrentUser
    Install-Module -Name PSReadLine
    Install-Module -Name Terminal-Icons -Repository PSGallery
    Install-Module -Name PSReadLine -Force #needed because it comes preinstalled and cannot be updated. Also we need latest version for Listview Prediction
    Install-Module -Name Terminal-Icons -Repository PSGallery
    exit
  3. pcostarg revised this gist Aug 4, 2022. No changes.
  4. pcostarg revised this gist Aug 4, 2022. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion $Profile.ps1
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,6 @@ Import-Module -Name Terminal-Icons
    $env:POSH_GIT_ENABLED = $true
    Import-Module posh-git

    oh-my-posh --init --shell pwsh --config C:\Users\pcosta\AppData\Local\Programs\oh-my-posh\themes\_ohmyposh-v1.omp.json | Invoke-Expression
    oh-my-posh --init --shell pwsh --config %LocalAppData%\Programs\oh-my-posh\themes\_ohmyposh-v1.omp.json | Invoke-Expression

    Enable-PoshTransientPrompt
    2 changes: 1 addition & 1 deletion Modules-Install.ps1
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    winget install JanDeDobbeleer.OhMyPosh
    Install-Module posh-git -Scope CurrentUser
    Install-Module -Name PSReadLine -AllowPrerelease -RequiredVersion 2.2.0-beta4 -Force
    Install-Module -Name PSReadLine
    Install-Module -Name Terminal-Icons -Repository PSGallery
  5. pcostarg created this gist Jan 14, 2022.
    14 changes: 14 additions & 0 deletions $Profile.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    if ($Host.Name -eq 'ConsoleHost') {
    Import-Module PSReadline
    Set-PSReadLineOption -PredictionSource History
    set-PSReadLineOption -PredictionViewStyle ListView
    }

    Import-Module -Name Terminal-Icons

    $env:POSH_GIT_ENABLED = $true
    Import-Module posh-git

    oh-my-posh --init --shell pwsh --config C:\Users\pcosta\AppData\Local\Programs\oh-my-posh\themes\_ohmyposh-v1.omp.json | Invoke-Expression

    Enable-PoshTransientPrompt
    4 changes: 4 additions & 0 deletions Modules-Install.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    winget install JanDeDobbeleer.OhMyPosh
    Install-Module posh-git -Scope CurrentUser
    Install-Module -Name PSReadLine -AllowPrerelease -RequiredVersion 2.2.0-beta4 -Force
    Install-Module -Name Terminal-Icons -Repository PSGallery
    155 changes: 155 additions & 0 deletions _ohmyposh-v1.omp.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,155 @@
    {
    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
    "final_space": false,
    "osc99": true,
    "console_title": true,
    "console_title_style": "folder",
    "blocks": [
    {
    "type": "prompt",
    "alignment": "left",
    "horizontal_offset": 0,
    "vertical_offset": 0,
    "segments": [
    {
    "type": "session",
    "style": "diamond",
    "foreground": "#ffffff",
    "background": "#c386f1",
    "leading_diamond": "",
    "properties": {
    "postfix": " ",
    "display_host": false
    }
    },
    {
    "type": "root",
    "style": "powerline",
    "powerline_symbol": "",
    "invert_powerline": false,
    "foreground": "#193549",
    "background": "#ffff66",
    "leading_diamond": "",
    "trailing_diamond": ""
    },
    {
    "type": "shell",
    "style": "powerline",
    "powerline_symbol": "",
    "invert_powerline": false,
    "foreground": "#ffffff",
    "background": "#0077c2",
    "properties": {
    "prefix": "",
    "postfix": ""
    }
    },
    {
    "type": "path",
    "style": "powerline",
    "powerline_symbol": "",
    "invert_powerline": false,
    "foreground": "#ffffff",
    "background": "#ff479c",
    "properties": {
    "prefix": "",
    "style": "agnoster"
    }
    },
    {
    "type": "git",
    "style": "powerline",
    "powerline_symbol": "",
    "invert_powerline": false,
    "foreground": "#193549",
    "background": "#fffb38",
    "properties": {
    "display_status": true,
    "display_stash_count": true,
    "display_upstream_icon": true
    }
    },
    {
    "type": "dotnet",
    "style": "powerline",
    "powerline_symbol": "",
    "invert_powerline": false,
    "foreground": "#ffffff",
    "background": "#6CA35E",
    "leading_diamond": "",
    "trailing_diamond": "",
    "properties": {
    "display_version": true,
    "prefix": ""
    }
    },
    {
    "type": "exit",
    "style": "powerline",
    "powerline_symbol": "",
    "invert_powerline": false,
    "foreground": "#ffffff",
    "background": "#2e9599",
    "leading_diamond": "",
    "trailing_diamond": "",
    "properties": {
    "always_enabled": true,
    "color_background": true,
    "display_exit_code": false,
    "error_color": "#f1184c",
    "prefix": ""
    }
    }
    ]
    },
    {
    "type": "prompt",
    "alignment": "right",
    "segments": [
    {
    "type": "ytm",
    "style": "powerline",
    "powerline_symbol": "\uE0B2",
    "invert_powerline": true,
    "foreground": "#111111",
    "background": "#1BD760",
    "properties": {
    "prefix": " \uF167 ",
    "paused_icon": "",
    "playing_icon": ""
    }
    },
    {
    "type": "time",
    "style": "powerline",
    "invert_powerline": true,
    "leading_diamond": "\uE0B2",
    "trailing_diamond": "\uE0B4",
    "background": "#2e9599",
    "foreground": "#111111"
    }
    ]
    },
    {
    "type": "prompt",
    "alignment": "left",
    "newline": true,
    "segments": [
    {
    "type": "text",
    "style": "plain",
    "foreground": "#007ACC",
    "properties": {
    "prefix": "",
    "text": "\uE602"
    }
    }
    ]
    }
    ],
    "transient_prompt": {
    "background": "transparent",
    "foreground": "#ffffff",
    "template": "<[{{ now | date \"02-01 15:04\" }}]{{ .Shell}}> {{ .Path }}> "
    }
    }