Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# copy below to $HOME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
$Host.PrivateData.DebugBackgroundColor = "DarkGray"
$Host.PrivateData.ErrorBackgroundColor = "DarkGray"
$tokenColors = @{
'Command' = 'White'
'Comment' = 'DarkGreen'
'Keyword' = 'Blue'
'Member' = 'Cyan'
'Number' = 'Yellow'
'Operator' = 'Magenta'
'Parameter' = 'Cyan'
'String' = 'Yellow'
'Type' = 'Green'
'Variable' = 'White'
}
if ($host.Name -eq 'ConsoleHost') {
Import-Module PSReadline
}
if((Get-Module -Name "PSReadline").Version.Major -gt 1) {
Set-PSReadLineOption -Colors $tokenColors
} else {
foreach ($tokenColor in $tokenColors.GetEnumerator()) {
Set-PSReadlineOption -TokenKind $tokenColor.Name -ForegroundColor $tokenColor.Value
}
}
Set-PSReadlineOption -EditMode Emacs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.