我最近下载了 VS code editor这真的很好。
但我在其中发现的唯一问题是颜色主题,我习惯于
monokai 颜色主题就像在崇高的文本中一样,我找不到编辑的方法
颜色主题或下载颜色主题只有 2 个选项:
如何添加我自己的主题或复制现有主题,以便我能够
按照我的意愿编辑配色方案?
我设法更改了以下文件中的一些颜色,但仍然
我不知道如何添加全新的主题:
resources/app/client/vs/monaco/ui/workbench/native/native.main.css
看起来颜色主题很快就会可用,它将成为插件系统的一部分
visual-studio-code/suggestions/7756227-theme
最佳答案
Visual Studio Code 0.9.0 及更高版本
有关于如何添加自定义主题的官方文档:https://github.com/Microsoft/vscode-docs/blob/0.9.0/release-notes/latest.md
您需要一个 .tmtheme
您要添加的主题的文件。您可以找到现有文件,例如在 GitHub 上,ColorSublime或者您可以定义自己的主题文件(例如使用 https://github.com/aziz/tmTheme-Editor )。
找到后.tmtheme
文件,您有两种方法可以基于它创建扩展名。
选项 1:使用 Yeoman 生成器
npm install -g yo
安装 yo(如果您还没有安装) npm install -g generator-code
yo code
并选择 New Color Theme
.tmTheme
文件、主题名称、ui 主题等)选项2:自己创建目录
mytheme
. themes
并放置 .tmTheme
里面的文件 package.json
在扩展文件夹的根目录中,内容如下{
"name": "theme-mytheme",
"version": "0.0.1",
"engines": {
"vscode": ">=0.9.0-pre.1"
},
"publisher": "me",
"contributes": {
"themes": [
{
"label": "My Theme",
"uiTheme": "vs-dark", // use "vs" to select the light UI theme
"path": "./themes/mytheme.tmTheme"
}
]
}
}
最后将您的扩展添加到 Visual Studio Code
将扩展文件夹复制到扩展目录。这是:
%USERPROFILE%\.vscode\extensions
$HOME/.vscode/extensions
重启VSCode,在
File -> Preferences -> Color Theme
中选择新的主题Visual Studio 代码 0.8.0
可以在 Visual Studio Code 0.8.0 中添加新主题(2015 年 8 月 31 日发布给内部人员 [成为内部人员:https://www.instant.ly/s/Y5nt1/nav#p/186a0])。
安装 VSCode 0.8.0 或更高版本后,请执行以下操作以应用您自己的主题:
.tmTheme
文件或创建自己的文件(例如使用 https://github.com/aziz/tmTheme-Editor ).tmTheme
文件到 %CODEFOLDER%/resources/app/plugins/vs.theme.starterkit/themes
.tmTheme
文件在 %CODEFOLDER%/resources/app/plugins/vs.theme.starterkit/ticino.plugin.json
通过为它添加一个条目,如下所示:{
"id": "vs-theme-mynewtheme", // internal ID
"label": "MyNewTheme", // displayed name for the theme
"uiTheme": "vs-dark", // general UI appeareance (
// "vs" for light themes,
// "vs-dark" for dark themes)
"path": "./themes/myNewTheme.tmTheme" // file path
},
File -> Preferences -> Color Theme
中选择新的主题关于color-scheme - 如何在 Visual Studio Code 中添加主题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30011737/