How to edit default dark theme for Visual Studio C

2019-01-21 00:23发布

I'm using Windows 7 64-bit.

Is there a way to edit default dark theme in the Visual Studio Code? In %USERPROFILE%.vscode folder there are only themes from the extensions, while in installation path (I used default, C:\Program Files (x86)\Microsoft VS Code) there are files of some standard themes in \resources\app\extensions, like Kimbie Dark, Solarized Dark/Light or variants of Monokai, but there is no default dark theme.

But if after all there is a possibility to edit it, then which blocks of code are responsible for colour of member of object, member of pointer and name of class and structure in the C++ language?

10条回答
Juvenile、少年°
2楼-- · 2019-01-21 00:24

You cannot "edit" a default theme, they are "locked in"

However, you can copy it into your own custom theme, with the exact modifications you'd like.

For more info, see these articles: https://code.visualstudio.com/Docs/customization/themes https://code.visualstudio.com/docs/extensions/install-extension#_your-extensions-folder

If all you want to change is the colors for C++ code, you should look at overwriting the c++ support colorizer. For info about that, go here: https://code.visualstudio.com/docs/customization/colorizer

EDIT: The dark theme is found here: https://github.com/Microsoft/vscode/tree/80f8000c10b4234c7b027dccfd627442623902d2/extensions/theme-colorful-defaults

EDIT2: To clarify:

查看更多
We Are One
3楼-- · 2019-01-21 00:25

There is now the option modify the current theme which will copy the current theme settings and let you save it as a *.color-theme.json JSON5 file

Generate color theme from current settings

A much simpler way however would be to edit the user settings and customise workbench.colorCustomizations

Editing color customizations

查看更多
Root(大扎)
4楼-- · 2019-01-21 00:29

The docs now have a whole section about this.

Basically, use npm to install yo, and run the command yo code and you'll get a little text-based wizard -- one of whose options will be to create and edit a copy of the default dark scheme.

查看更多
做个烂人
5楼-- · 2019-01-21 00:30

I had the same problem and after studying the whole issue, I wrote a guide explaining a bit how the VSC theming works and how to write one theme from scratch: https://medium.com/@caludio/how-to-write-a-visual-studio-code-color-theme-from-scratch-7ccb7e5da2aa

查看更多
Evening l夕情丶
6楼-- · 2019-01-21 00:32

In VS code 'User Settings', you can edit visible colours using the following tags(this is a sample and there are much more tags),

"workbench.colorCustomizations": {
    "list.inactiveSelectionBackground": "#C5DEF0",
    "sideBar.background": "#F8F6F6",
    "sideBar.foreground": "#000000",
    "editor.background": "#FFFFFF",
    "editor.foreground": "#000000",
    "sideBarSectionHeader.background": "#CAC9C9",
    "sideBarSectionHeader.foreground": "#000000",
    "activityBar.border": "#FFFFFF",
    "statusBar.background": "#102F97",
    "scrollbarSlider.activeBackground": "#77D4CB",
    "scrollbarSlider.hoverBackground": "#8CE6DA",
    "badge.background": "#81CA91"}

If you want to edit some C++ color tokens, use the following tag,

"editor.tokenColorCustomizations": {
    "numbers": "#2247EB",
    "comments": "#6D929C",
    "functions": "#0D7C28"
}
查看更多
地球回转人心会变
7楼-- · 2019-01-21 00:37

in your VS Code:

Ctrl+K Ctrl+T

查看更多
登录 后发表回答