GuardianX
GuardianX

Reputation: 512

How can I make user-defined highlight for C# in VS Code

Recently I installed VS Code and C# plugin for it. I must say that I really like the editor. It is very lightweight and highly customizable. However I haven't found how can I redefine several colorization options such as highlighting classes inside field definitions or local variables?

I already use standard C# colorizer. I just want to customize the color of some lexemes, not everything.

Upvotes: 2

Views: 1724

Answers (2)

Pointer Null
Pointer Null

Reputation: 40391

Install theme from extensions from which you wish to start.

Then find where the theme got installed. On Windows it would be %USERPROFILE%\.vscode\extensions, see details in Installing extensions.

There you'll find folder with theme, inside is themes folder and <something>.tmTheme file which is actually xml file. Open it inside VSCode and start editing :)

You'll find items and colors, syntax is described elsewhere, but common sense will help you.

To test change, open desired .cs file in same editor. Changes are applied after restart, so it's also good to make key shortcut to restart the editor:

keybindings.json

...
{
   "key": "ctrl+shift+alt+r",
   "command": "workbench.action.reloadWindow"
}
...

Then try color, restart, see result, continue...

Upvotes: 0

FunkyPeanut
FunkyPeanut

Reputation: 1182

Checkout the docs here:

https://code.visualstudio.com/Docs/customization/colorizer

You basically either get one from the marketplace or generate a basic editable file with yeoman.

You can also add themes even from color sublime as described here:

https://code.visualstudio.com/docs/customization/themes

Upvotes: 2

Related Questions