Last active
April 21, 2022 15:42
-
-
Save steelx/e896abb55d126ba95add23ba5911bb75 to your computer and use it in GitHub Desktop.
windows terminal oh-my-posh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"final_space": false, | |
"osc99": true, | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [ | |
{ | |
"type": "path", | |
"style": "powerline", | |
"powerline_symbol": "\uE0B0", | |
"foreground": "#ffffff", | |
"background": "#61AFEF", | |
"properties": { | |
"prefix": " \uE5FF ", | |
"style": "folder" | |
} | |
} | |
] | |
}, | |
{ | |
"type": "node", | |
"style": "powerline", | |
"powerline_symbol": "\uE0B0", | |
"foreground": "#ffffff", | |
"background": "#6CA35E", | |
"properties": { | |
"prefix": " \uE718 " | |
} | |
}, | |
{ | |
"type": "poshgit", | |
"style": "powerline", | |
"powerline_symbol": "\uE0B0", | |
"foreground": "#ffffff", | |
"background": "#0077c2" | |
}, | |
{ | |
"type": "python", | |
"style": "powerline", | |
"powerline_symbol": "\uE0B0", | |
"foreground": "#100e23", | |
"background": "#906cff", | |
"properties": { | |
"prefix": " \uE235 " | |
} | |
}, | |
{ | |
"type": "os", | |
"style": "plain", | |
"foreground": "#26C6DA", | |
"background": "#546E7A", | |
"properties": { | |
"postfix": " \uE0B1", | |
"macos": "mac" | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module posh-git | |
Import-Module oh-my-posh | |
$omp_config = Join-Path $PSScriptRoot ".\ajinkya.omp.json" | |
oh-my-posh --init --shell pwsh --config $omp_config | Invoke-Expression | |
Import-Module -Name Terminal-Icons | |
Set-PoshPrompt Lambda | |
# PSReadLine | |
Set-PSReadLineOption -EditMode Emacs | |
Set-PSReadLineOption -BellStyle None | |
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar | |
Set-PSReadLineOption -PredictionSource History | |
# Fzf | |
Import-Module PSFzf | |
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReverseHistory 'Ctrl+r' | |
# Env | |
$env:GIT_SSH = "C:\Windows\system32\OpenSSH\ssh.exe" | |
# Alias | |
Set-Alias -Name vim -Value nvim | |
Set-Alias ll ls | |
Set-Alias g git | |
Set-Alias grep findstr | |
Set-Alias tig 'C:\Program Files\Git\usr\bin\tig.exe' | |
Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe' | |
# Utilities | |
function which ($command) { | |
Get-Command -Name $command -ErrorAction SilentlyContinue | | |
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue | |
} | |
Themes can be installed at C:\Users\<USERNAME>\.config\powershell
Set-PoshPrompt -Theme atomicBit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install needed modules first:
How to load ps1 file first.
notepad $PROFILE.CurrentUserCurrentHost
. $PROFILE
fix restrictions
Set-ExecutionPolicy Unrestricted -scope CurrentUser