如何根据包含的文本更改文件名的文本颜色或背景色?

huangapple go评论50阅读模式
英文:

Vscode: how to change text-color or background of a filename depending if includes some text

问题

我非常注重视觉效果,如果文件名包含特定名称,那么根据名称的不同添加一些样式会很棒。

例如,如果我的文件名包含“pay”,则将字体文本设置为蓝色。

英文:

Im very visual, and would be amazing if the namefile gets some styles depending of the name.

Example if my filename contains "pay" then get font-text blue.

如何根据包含的文本更改文件名的文本颜色或背景色?

答案1

得分: 1

以下是新的扩展:Decorate Files,它允许您通过不同的路径来装饰编辑器选项卡和资源管理器文件名的颜色。这是一个示例设置:

如何根据包含的文本更改文件名的文本颜色或背景色?

在这些设置中,我已经装饰了所有以.js结尾的文件,文件路径中包含READMEpackage.json的文件以及所有以eslintrc.json结尾的文件。颜色可以是您想要的任何颜色,只要它是有效的十六进制代码。务必阅读README。

正如您所看到的,您还可以针对只读文件、不在当前工作区的文件、多根文件夹和一般文件夹进行设置。所有设置都是可选择的。我将很快为此回答添加更多信息。

英文:

Here is the new extension: Decorate Files which allows you to decorate the colors of editor tabs and Explorer fileNames by various paths. Here is a sample setting:

如何根据包含的文本更改文件名的文本颜色或背景色?

In these settings, I have decorated all files ending with .js, files with README or package.json in the file path and all files ending with eslintrc.json. The colors can be anything you want, as long as it is a valid hex code. Be sure to read the README.

As you can see, you can also target read-only files, files that are not in the current workspace, multiroot folders, and folders generally. All settings are opt-in. I will add more info to this answer soon.

huangapple
  • 本文由 发表于 2023年6月29日 03:51:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76576313.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定