Yes, you can change the font used for comments however for something so apparently simple, it is rather long winded and the results are not 100% perfect. For instance you may find that the cursor is slightly further away from the resulting text when you write comments. If you can live with this, here is the process.
Here is my set-up, just to show it can be done:

You are going to do the following:
Create the stylesheet
You need to go to the root of your VS Code installation for this part. I'm on Mac so you will need to identify your own path if on PC.
For me on a Mac this is Users/username/.vscode/
Navigate to that directory in terminal and then touch style.css
to create the stylesheet.
Once you have made the stylesheet, you will want to add your font rule. But first you need to know what class to target. To identify the class, open Dev Tools within VS Code. Then hover over a comment to see the class. Mine is .mtk3
but I've heard these vary across updates so best to check for yourself.
Ok, now add the style, e.g
.mtk3 {
font-family: "iosevka";
font-size: 1em;
font-style: italic;
}
Link to your stylesheet
Now we need to make sure that VS Code knows about the stylesheet.
So open up settings.json
. (You want the global file with this name, not any local ones you may have in your individual projects.) Once you have this open, add the following entry:
"vscode_custom_css.imports": ["file:///Users/username/.vscode/style.css"],
Note that you are specifying a JSON array for the file, not a single value. Obviously the path should be your own. Bear in mind this is a link reference not actually a file path so you may need to prepend the path with the Windows equivalent of file://
.
Install the plugin
This still isn't enough to get the styles working. You need to be able to run the command update custom css and js
from within the editor and this doesn't come as default. So install the following plugin: Custom CSS and JS Loader .
Once installed you can Cmd+Shift+P
and type 'Enable custom CSS and JS'. The option appears, select it. Now restart VS Code, or run reload window
, you should have your fancy comment font.
As I say, the cursor acts a bit erratically but it's not too distracting as you don't write comments much compared to code. It may be that I need to target more mtk
classes. Maybe someone can elaborate on this in the comments, if they know the reason.