/
Set-ReadablePSReadlineColor.ps1
86 lines (76 loc) · 4.02 KB
/
Set-ReadablePSReadlineColor.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# set-psreadlineoption -EmphasisForegroundColor Blue -EmphasisBackgroundColor Black
if (Get-Module 'PSReadline' -ea 0) {
Set-PSReadLineOption -ForeGround Yellow -Token None
Set-PSReadLineOption -ForeGround Green -Token Comment
Set-PSReadLineOption -ForeGround Green -Token Keyword
Set-PSReadLineOption -ForeGround Cyan -Token String
Set-PSReadLineOption -ForeGround Gray -Token Operator
Set-PSReadLineOption -ForeGround Green -Token Variable
Set-PSReadLineOption -ForeGround Yellow -Token Command
Set-PSReadLineOption -ForeGround Gray -Token Parameter
Set-PSReadLineOption -ForeGround Gray -Token Type
Set-PSReadLineOption -ForeGround White -Token Number
Set-PSReadLineOption -ForeGround White -Token Member
$Host.PrivateData.ErrorBackgroundColor = 'DarkRed'
$Host.PrivateData.ErrorForegroundColor = 'White'
$Host.PrivateData.VerboseBackgroundColor = 'Black'
$Host.PrivateData.VerboseForegroundColor = 'Yellow'
$Host.PrivateData.WarningBackgroundColor = 'Black'
$Host.PrivateData.WarningForegroundColor = 'White'
set-psreadlinekeyhandler -chord 'Tab' -Func TabCompleteNext ### !!!!!
set-psreadlinekeyhandler -chord 'Shift+Tab' -Func TabCompletePrevious ### !!!!!
set-psreadlinekeyhandler -chord 'Shift+SpaceBar' -Func Complete ### !!!!!
Set-PSReadlineOption -token string -fore white
Set-PSReadlineOption -token None -fore yellow
Set-PSReadlineOption -token Operator -fore cyan
Set-PSReadlineOption -token Comment -fore green
Set-PSReadlineOption -token Parameter -fore green
Set-PSReadlineOption -token Comment -fore Yellow -back DarkBlue
Set-PSReadLineOption -ForeGround Yellow -Token None
Set-PSReadLineOption -ForeGround Green -Token Comment
Set-PSReadLineOption -ForeGround Green -Token Keyword
Set-PSReadLineOption -ForeGround Cyan -Token String
Set-PSReadLineOption -ForeGround White -Token Operator
Set-PSReadLineOption -ForeGround Green -Token Variable
Set-PSReadLineOption -ForeGround Yellow -Token Command
Set-PSReadLineOption -ForeGround Cyan -Token Parameter
Set-PSReadLineOption -ForeGround White -Token Type
Set-PSReadLineOption -ForeGround White -Token Number
Set-PSReadLineOption -ForeGround White -Token Member
}
If ($Host.PrivateData -and ($host.PrivateData.ErrorBackgroundColor -as [string])) {
$Host.PrivateData.ErrorBackgroundColor = 'DarkRed'
$Host.PrivateData.ErrorForegroundColor = 'White'
$Host.PrivateData.VerboseBackgroundColor = 'Black'
$Host.PrivateData.VerboseForegroundColor = 'Yellow'
$Host.PrivateData.WarningBackgroundColor = 'Black'
$Host.PrivateData.WarningForegroundColor = 'White'
}
<#
DefaultTokenForegroundColor : Yellow
CommentForegroundColor : Green
KeywordForegroundColor : White
StringForegroundColor : White
OperatorForegroundColor : Yellow
VariableForegroundColor : Green
CommandForegroundColor : Yellow
ParameterForegroundColor : Green
TypeForegroundColor : Green
NumberForegroundColor : White
MemberForegroundColor : White
DefaultTokenBackgroundColor : DarkCyan
CommentBackgroundColor : DarkBlue
KeywordBackgroundColor : DarkCyan
StringBackgroundColor : DarkCyan
OperatorBackgroundColor : DarkCyan
VariableBackgroundColor : DarkCyan
CommandBackgroundColor : DarkCyan
ParameterBackgroundColor : DarkCyan
TypeBackgroundColor : DarkCyan
NumberBackgroundColor : DarkCyan
MemberBackgroundColor : DarkCyan
EmphasisForegroundColor : Cyan
EmphasisBackgroundColor : DarkCyan
ErrorForegroundColor : Red
ErrorBackgroundColor : DarkCyan
#>