Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Custom Posh-Git prompt
# Background colors
$GitPromptSettings.AfterBackgroundColor = "DarkBlue"
$GitPromptSettings.AfterStashBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BeforeBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BeforeIndexBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BeforeStashBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchAheadStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchBehindAndAheadStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchBehindStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.BranchIdenticalStatusToBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.DelimBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.IndexBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.LocalDefaultStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.LocalStagedStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.LocalWorkingStatusBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.StashBackgroundColor = $GitPromptSettings.AfterBackgroundColor
$GitPromptSettings.WorkingBackgroundColor = $GitPromptSettings.AfterBackgroundColor
# Foreground colors
$GitPromptSettings.BranchForegroundColor = "Blue"
$GitPromptSettings.BranchIdenticalStatusToForegroundColor = "White"
$GitPromptSettings.DelimForegroundColor = "Blue"
$GitPromptSettings.IndexForegroundColor = "Green"
$GitPromptSettings.WorkingForegroundColor = "Yellow"
# Prompt shape
$GitPromptSettings.AfterText = " "
$GitPromptSettings.BeforeText = " "
$GitPromptSettings.BranchIdenticalStatusToSymbol = ""
$GitPromptSettings.DelimText = " ॥"
$GitPromptSettings.LocalStagedStatusSymbol = ""
$GitPromptSettings.LocalWorkingStatusSymbol = ""
$GitPromptSettings.ShowStatusWhenZero = $false
$windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$windowsPrincipal = new-object 'System.Security.Principal.WindowsPrincipal' $windowsIdentity
if ($psISE) { $color = "Black"; }
elseif ($windowsPrincipal.IsInRole("Administrators") -eq 1) { $color = "Red"; }
else { $color = "Green"; }
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
write-host " " -NoNewLine
Write-VcsStatus
write-host " " -NoNewLine
if ((get-location -stack).Count -gt 0) {
write-host (("+" * ((get-location -stack).Count))) -NoNewLine -ForegroundColor Cyan
write-host " " -NoNewLine
}
write-host "$" -NoNewLine -ForegroundColor $color
return " "
Owner

bradwilson commented Mar 15, 2016

Colors I use in ConEmu:

cr3qy-nveaabvqw

Would you mind posting a brief recording/gif demoing your settings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment