how can I change the color of the characters that come before and after a comment in vs code. Im Talking about or /* */ or # characters. I know how to change the comment color
How do I change color of comments in visual studio code?
but couldn’t find anything regarding the „framing“ characters.
Press 'Ctrl+shift+P' from the keyboard to open VS Code command palette. Search: 'Inspect Editor Tokens and Scopes' Take the cursor on the text or tag, you want to change the colors.
Open your VS editor. Navigate to the upper part of the screen and select File. Now, in the drop-down menu, go to Preferences > Settings. You'll now see the Commonly Used section with a menu on the right-side of the screen, you can access the font from this page or by following the step below.
You can do this rather simply. Use "Inspect TM Scopes
" in the command palette to inspect those characters. It will give a different scope for each language, something like :
punctuation.definition.comment.js
for javascript comments. Now you can use that in your user settings like so:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "punctuation.definition.comment.js",
"settings": {
"foreground": "#f00",
}
}
]
}
You will obviously have a different but similar scope for other languages.
And see the short answer added to How to change VisualStudioCode comment color with it's slashes? about possible plans to fix this in the October, 2019 release. So the punctuation would not have to be independently colored. [It is now fixed in the Insider's Build.]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With