It’s easy for a developer to underestimate the importance of their work environment. No, we aren’t talking about your chair, desk, and wall color. We’re talking about your virtual work environment.
Making your Visual Studio code editor feel like home is immensely important for your work efficiency. The font covers a large chunk of the overall VS feel. In this article, we’ll teach you how to edit fonts in various parts of the VS Code editor.
How to Change Font in VS Code
Even if you are a developer who has been working with VS for a long time now, you still might not know about its font changing options.
If you don’t care about why choosing your own font is important, jump straight to the tutorial a few paragraphs below. Bear in mind, though, that the reasons for changing your font (outlined below) can help your decision.
Why are fonts so important in VS? Well, if the aesthetics aspect isn’t enough for you (and trust us, after hours and hours spent in a code editor, it starts to matter), it’s actually also about functionality. So, what makes a font “appropriate” for VS?
Primarily, you’ll want the distinction between similar characters to be notable. For instance, easily distinguishing the number 1 and the lowercase L can significantly speed up your coding and save you time.
Then, there’s the fact that some developers like to use ligatures. Ligatures are a few symbols joined together. These are also called “glyphs,” and they can mean a whole lot when coding.
Without further ado, here’s how to change the font family in VS:
- 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.
- Or click on Text Editor > Font and look for the default entry “editor.fontFamily”: “Consolas”.
- Then, instead of “Consolas,” input the name of your preferred font.
This should automatically change the font family.
How to Change Font Size in VS Code
Even if you have perfect eyesight, you’ll want to keep your eyes as comfortable as possible when writing lines of code. Just like the discrepancy between similar characters is important when choosing a font family, the font size is important for making coding easier on the eye and helping you work more efficiently.
There isn’t a magical formula for the best font size for coding. Ideally, you’ll want to see the characters as clearly as possible, but you’ll also want the line to fit the VS window. So, try different font sizes and find the perfect one that fits your coding needs.
Here’s how to change the font size in VS Code:
- Navigate to the User Settings menu (step number 3 in the font tutorial).
- Look for the “editor.fontSize”: 15 line, your font size might be set to something different.
- Then, instead of 15, enter your preferred font size.
How to Change Font of Explorer in VS Code
The Explorer feature in VS Code works just like the explorer feature in most other apps. It is used to manage, browse, and open files and folders to work on your project. Since VS Code is based on folders and files, the Explorer makes it easy for you to get started – just open the file/folder using VS Code. It’s as simple as that.
You can expect to be using the VS Code Explorer a fair bit. If the Explorer’s font size doesn’t suit you, you’ll be happy to know that you can change it.
- Go to the User Settings menu again.
- Find the “editor.fontSize”: 14 entry, your font size may differ.
- Change this to a font size of your choice, 18 is used in this example.
How to Change Terminal Font in VS Code
Instead of switching windows or making changes to the existing terminal’s state, VS Code allows you to use an integrated terminal, which is found at your project’s/workspace’s root. Of course, you might want to make changes to the font here for ease of use. Here’s how to go about changing the VS Code terminal font:
- Navigate to the root folder of your project/workspace.
- Open the settings.json file using VS Code. Alternatively, in VS Code, press Ctrl + Shift + P (instead of Ctrl, use Command for Mac devices) and find the settings.json file.
- Change the corresponding three lines to this:
“terminal.external.osxExec”: “iTerm.app”,
“terminal.integrated.shell.osx”: “/bin/zsh”,
“terminal.integrated.fontFamily”: “D2Coding”,
Note that D2Coding is an example. You can also choose any other font you prefer.
- Save the settings when finished.
To change the terminal font size, navigate to the “terminal.integrated.fontSize”: entry and set it to that of your own preference.
How to Change Font for Comments in VS Code
Code comment entries are, by default, in the same font as the rest of the code. Changing this makes them stand out, which can often prevent hours of wasted work (it’s easy to miss a comment when it’s in the same font as everything else in VS). As simple as this kind of thing may seem, the solution is a bit more complex than you’d expect. Also, the results might not be ideal, as this might cause some alignment issues. Still, it doesn’t hurt to try:
- Go to the root installation folder for VS Code on your device.
- Navigate to the touch style.css entry in the terminal. This will create a stylesheet.
- Now, it’s time to add the font rule. Here’s an example of a style:
.mtk3 {
font-family: "iosevka";
font-size: 1em;
font-style: italic;
}
- Open settings.json and add this entry:
"vscode_custom_css.imports":
"file:///Users/username/.vscode/style.css"],
- Now, download the Custom CSS and JS Loader plugin.
- Once it’s installed, use the Ctrl + Shift + P command and make sure that the plugin is enabled.
- Restart VS Code.
- The comments should now have a new font.
How to Change Sidebar Font Size in VS Code
There is no setting in VS Code that enables the user to change the terminal’s font size. However, a workaround exists, and it involves the mentioned Custom CSS and JS Loader plugin.
- In the plugin, navigate to the extension details and follow the tutorial section carefully.
- Use the following logic:
"vscode_custom_css.imports": ["[insert custom file URL]"]
- Do this for each custom file.
The result should make for a much better and aesthetically pleasing VS Code sidebar.
How to Change Font Using Different Operating Systems
If you’re coding in VS, you’re either using a Windows computer, a Mac, or a Linux system. Although these three aren’t identical in terms of VS, the differences mostly boil down to the Ctrl/Cmd key option and the default locations of the VS Code files. So, the principle of font changing in VS Code remains pretty much the same across all devices.
Additional FAQ
Why can’t I change the font in VS Code?
There are many mistakes you can make in VS Code, and changing the font is not as straightforward as doing so in MS Word. As you’ll be using a lot of coding to change the actual VS Code font, you should know about the most common oversight people make. Make sure that each entry is surrounded by quotation marks. For example, “vscode_custom_css.imports”: [“file:///Users/username/.vscode/style.css”], won’t work unless you use the quotation marks. Additionally, make sure that you use spaces between the commands.
Which font is used for code in VS Code?
By default, the font used for coding in VS Code is Consolas. If you follow this guide, you can change most fonts in VS Code, whether we’re talking about the code itself, the terminal, the comments, or the explorer feature.
However, if you’re talking about the font found on the VS Code’s official website images, no one can tell you which one was used. Unless VS Code developers explicitly reveal which font was used, there is no way of finding out.
How do I hack a VS Code font?
Originally, to hack meant to modify, but, if by this you mean adding the Hack font to VS, you can add it via the Hack’s website. Download the TrueType font from Hack. Extract the downloaded zip file. Install the extracted files. Then, go to Tools, followed by Options. In the Options menu, select Environment, and then navigate to Fonts and Colors. Open the Font dropdown menu and select the Hack entry.
What font do hackers use?
As a rule of thumb, every coder, including hackers, uses a font they like. A good example of a popular font that’s allegedly a “hacker’s choice” would be Ray Bluetens, also known as Lawn Dart Fonts.
Changing Font Options in VS Code
Dealing with font options in VS Code is definitely not as straightforward as changing fonts in a text editor program. However, considering we’re talking about coding software here, VS offers a wide variety of options compared to its competition. Follow the instructions in this article and make your coding experience as personalized, user-friendly, and smooth as possible.
Did you manage to edit your font settings in VS Code? Did you run into any problems? Scroll down and check out our comments section below. It’s teeming with good advice. Don’t refrain from asking a question of your own or starting a discussion either. Our community is more than happy to help.