|
| 1 | +<# Based on norm zsh theme. Check it (https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/norm.zsh-theme) #> |
| 2 | + |
| 3 | +function global:prompt { |
| 4 | + $realCommandStatus = $? |
| 5 | + $realLASTEXITCODE = $LASTEXITCODE |
| 6 | + $lambda = [char]::ConvertFromUtf32(955) |
| 7 | + $forwardArrow = [char]::ConvertFromUtf32(8594) |
| 8 | + |
| 9 | + if ( $realCommandStatus -eq $True ) { |
| 10 | + $EXIT="Yellow" |
| 11 | + } else { |
| 12 | + $EXIT="Red" |
| 13 | + } |
| 14 | + |
| 15 | + $CurrentDirectory = Split-Path -leaf -path (Get-Location) |
| 16 | + |
| 17 | + Write-Host |
| 18 | + Write-Host "$lambda $env:USERNAME " -ForegroundColor Yellow -NoNewline |
| 19 | + Write-Host "$CurrentDirectory" -NoNewLine -ForegroundColor Green |
| 20 | + |
| 21 | + if(Get-GitStatus){ |
| 22 | + Write-Host " $forwardArrow $lambda " -ForegroundColor Yellow -NoNewline |
| 23 | + Write-Host "git" -ForegroundColor Blue -NoNewline |
| 24 | + checkGit(Get-Location) |
| 25 | + } |
| 26 | + |
| 27 | + Write-Host " $forwardArrow" -NoNewLine -ForegroundColor $EXIT |
| 28 | + $global:LASTEXITCODE = $realLASTEXITCODE |
| 29 | + return " " |
| 30 | +} |
| 31 | + |
| 32 | +$global:PSColor = @{ |
| 33 | + File = @{ |
| 34 | + Default = @{ Color = 'White' } |
| 35 | + Directory = @{ Color = 'Green'} |
| 36 | + Reparse = @{ Color = 'Magenta'} |
| 37 | + Hidden = @{ Color = 'DarkGray'; Pattern = '^\.' } |
| 38 | + Code = @{ Color = 'Magenta'; Pattern = '\.(java|c|cpp|cs|js|css|html|Dockerfile|gradle| |
| 39 | + pp|packergitignore|gitattributes|go|)$' } |
| 40 | + Executable = @{ Color = 'Green'; Pattern = '\.(exe|bat|cmd|py|pl|ps1|psm1|vbs|rb|reg|sh|fsx|)$' } |
| 41 | + Text = @{ Color = 'Cyan'; Pattern = '\.(txt|cfg|conf|ini|csv|log|config| |
| 42 | + xml|yml|md|markdown|properties|json|todo)$' } |
| 43 | + Compressed = @{ Color = 'Yellow'; Pattern = '\.(zip|tar|gz|rar|jar|war)$' } |
| 44 | + } |
| 45 | + Service = @{ |
| 46 | + Default = @{ Color = 'White' } |
| 47 | + Running = @{ Color = 'DarkGreen' } |
| 48 | + Stopped = @{ Color = 'DarkRed' } |
| 49 | + } |
| 50 | + Match = @{ |
| 51 | + Default = @{ Color = 'White' } |
| 52 | + Path = @{ Color = 'Green'} |
| 53 | + LineNumber = @{ Color = 'Yellow' } |
| 54 | + Line = @{ Color = 'White' } |
| 55 | + } |
| 56 | +} |
0 commit comments