简体   繁体   English

在posh-git / powershell提示符下更改颜色

[英]Changing colours at posh-git/powershell prompt

I can not work out how to change the -b flag and the quoted string to something more readable. -b如何将-b标志和带引号的字符串更改为更易读的内容。

I have tried changing git settings, posh-git settings, and powershell settings. 我试过更改git设置, posh-git设置和powershell设置。 This stack answer was my last hope but I couldn't find which token-flag i need to change :( 这个堆栈答案是我最后的希望,但是我找不到我需要更改的令牌标记 :(

Can anyone give an example of how I can change all switches/flags and quoted strings to something brighter? 谁能举例说明如何将所有开关/标志和带引号的字符串更改为更亮的内容? Thanks. 谢谢。

在此处输入图片说明

From the documentation you referenced: 从您引用的文档中

Parameter 参数
A parameter to a command, always begins with a dash ('-'), followed by the parameter name. 命令的参数始终以短划线('-')开头,后跟参数名称。 Tokens with this kind are always instances of ParameterToken. 这种令牌始终是ParameterToken的实例。
[…] […]
StringExpandable StringExpandable
A double quoted string literal. 双引号字符串文字。 Tokens with this kind are always instances of StringExpandableToken even if there are no nested tokens to expand. 即使没有嵌套令牌可以扩展,此类令牌也始终是StringExpandableToken的实例。
StringLiteral 字符串字面量
A single quoted string literal. 单引号字符串文字。 Tokens with this kind are always instances of StringLiteralToken. 这种令牌始终是StringLiteralToken的实例。

So this should do what you want: 所以这应该做你想要的:

Set-PSReadlineOption -TokenKind Parameter -ForegroundColor Gray
Set-PSReadlineOption -TokenKind StringExpandable -ForegroundColor Cyan
Set-PSReadlineOption -TokenKind StringLiteral -ForegroundColor Cyan

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM