Switching to PowerLine + Additional minor changes

Styling will be based on PowerLine module.
Placed _ll command/alias correctly based on platform
This commit is contained in:
Gal Szkolnik 2021-10-11 20:56:10 -04:00
parent 79e85bb21d
commit 86c1189211
8 changed files with 48 additions and 6 deletions

View file

@ -3,7 +3,7 @@ class MyScript { #: System.Management.Automation.IValidateSetValuesGenerator {
$local:possibleValues = $(
Get-MyPackages -ReturnFullPath -IncludeRoot -Force:$(-not $CurrentOnly) |
Get-ChildItem -Recurse -Filter '*.ps1' |
Select-Object -ExpandProperty FullName | ForEach-Object {
Select-Object -Unique -ExpandProperty FullName | ForEach-Object {
$_ -replace '\.ps1$','' -replace "$($MyPSScriptRoot -replace '\\',"\\")[/\\]",''
}
)

View file

@ -7,7 +7,14 @@ $global:IsOutputANSICompatible = (
)
Get-Command -ListImported Set-PSReadLineKeyHandler -ErrorAction SilentlyContinue |
ForEach-Object { Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete }
if( (Get-Command -ListImported Set-PoshPrompt -ErrorAction SilentlyContinue) -and $IsOutputANSICompatible ) {
if( (Get-Command -ListImported Set-PowerLinePrompt -ErrorAction Ignore) ) {
$global:PSOSName = [SystemName]::_GetValidValues("",$true,$true) | Select-Object -First 1
if( Test-Path variable:global:GitPromptSettings ) {
$global:GitPromptSettings.TruncatedBranchSuffix = [char]0x2026
}
Set-PowerLinePrompt
} elseif( (Get-Command -ListImported Set-PoshPrompt -ErrorAction Ignore) -and $IsOutputANSICompatible ) {
$local:poshPrompt = Join-Path $HOME ".oh-my-posh.omp.json"
if( -not (Test-Path $poshPrompt) ) { $poshPrompt = "slim" }
Set-PoshPrompt -Theme $poshPrompt