I'm using Visual Studio Code version 1.11.2. I need to be able to see italicized comments in any language file, or at least JavaScript, Python, C, and C++. Is there a general setting for that or is there a programmatic way I can achieve that at the moment?
comment", ], "settings": { "fontStyle": "italic", // "fontStyle": "italic underline", // "fontStyle": "italic bold underline", } }, ] }, Related: How do I get Visual Studio Code to display italic fonts in formatted code? This is much easier to do and work in any theme, thanks.
Comment Code Block Ctrl+K+C/Ctrl+K+U If you select a block of code and use the key sequence Ctrl+K+C, you'll comment out the section of code. Ctrl+K+U will uncomment the code.
Thanks for pointing me in the right direction Victor. Putting this in my settings file (Visual Studio Code 1.42.1) did the trick:
"editor.tokenColorCustomizations": { "textMateRules": [ { "scope": "comment", "settings": { "fontStyle": "italic" } } ] }
You can see selector scopes by pressing ctrl/cmd + shift + p
, and looking for Developer: Inspect Editor Tokens and Scopes
.
You can apply settings to multiple scopes by providing an array:
"editor.tokenColorCustomizations": { "textMateRules": [ { "name": "Comment", "scope": [ "comment", "comment.block", "comment.block.documentation", "comment.line", "comment.line.double-slash", "punctuation.definition.comment", ], "settings": { "fontStyle": "italic", // "fontStyle": "italic underline", // "fontStyle": "italic bold underline", } }, ] },
Related: How do I get Visual Studio Code to display italic fonts in formatted code?
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