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:
parent
79e85bb21d
commit
86c1189211
|
@ -0,0 +1 @@
|
|||
_ls -la --color=auto $args
|
|
@ -0,0 +1 @@
|
|||
Get-ChildItem
|
|
@ -41,4 +41,3 @@ if( $Package ) {
|
|||
|
||||
if( $NamesOnly ) { return $rVal }
|
||||
return $rVal | ForEach-Object { Join-Path $MyPSScriptRoot "$_`.ps1" }
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
$local:MyPowerLineSetup = [ordered]@{
|
||||
Title = { "Sz PS" }
|
||||
SetCurrentDirectory = $true
|
||||
PowerLineFont = $true
|
||||
RestoreVirtualTerminal = $true
|
||||
PowerLineCharacters = [ordered]@{
|
||||
ColorSeparator = "$([char]::ConvertFromUtf32(0x2588)
|
||||
)$([PoshCode.Pansies.Entities]::ExtendedCharacters.ColorSeparator.Trim()[-1]) "
|
||||
ReverseColorSeparator = " $(
|
||||
[PoshCode.Pansies.Entities]::ExtendedCharacters.ReverseColorSeparator.Trim()[0]
|
||||
)$([char]::ConvertFromUtf32(0x2588))"
|
||||
Separator = " $([PoshCode.Pansies.Entities]::ExtendedCharacters.Separator.Trim()[-1]) "
|
||||
ReverseSeparator = " $(
|
||||
[PoshCode.Pansies.Entities]::ExtendedCharacters.ReverseSeparator.Trim()[0]) "
|
||||
}
|
||||
Colors = @( [rgbcolor]"Grey18", [rgbcolor]"Grey65" ) #, [rgbcolor]"white", [rgbcolor]"red", [rgbcolor]"blue" )
|
||||
Prompt = @(
|
||||
{ "`n" } # A spaced line
|
||||
{ New-PromptText -EBg VioletRed4 $MyInvocation.HistoryId }
|
||||
{ Get-Elapsed -Trim }
|
||||
{ Get-SegmentedPath -LengthLimit 30 }
|
||||
{ $local:_git_prompt = Write-VcsStatus; if( $_git_prompt ) { "$([PoshCode.Pansies.Entities]::ExtendedCharacters.Branch)$_git_prompt" } }
|
||||
|
||||
# Right-align block
|
||||
{ "`t" }
|
||||
{ "$env:USERNAME @ $env:COMPUTERNAME" }
|
||||
{ Get-Date -Format 'HH:mm:ss' }
|
||||
{ Get-Date -Format 'MM/dd ddd' }
|
||||
{ "$PSOSName " }
|
||||
|
||||
{ "`n" }
|
||||
{ New-PromptText { "PS" } -Ebg Red }
|
||||
)
|
||||
}
|
||||
Set-PowerLineTheme @MyPowerLineSetup
|
|
@ -1 +0,0 @@
|
|||
_ls -la --color=auto $args
|
|
@ -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 '\\',"\\")[/\\]",''
|
||||
}
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"Always": [
|
||||
"psreadline",
|
||||
"PowerShellCookbook",
|
||||
"oh-my-posh",
|
||||
"PowerLine",
|
||||
"posh-git",
|
||||
"z"
|
||||
]}
|
||||
|
|
Loading…
Reference in New Issue