How to Change Color of Text and Syntax in VS Code Editor
Are you a new web developer and just started using Visual Studio Code? If you don’t know how to change the color of Text and Syntax in VS Code Editor, then this article is exactly for you.
In this post, you will learn how to change the color of text and syntax in VS Code Editor 2023. Visual Studio Code by Microsoft is one of the most popular tools and software among web developers and software engineers.
Visual Studio Sode Syntax Highlighting Colors
Moreover, Most new developers are not satisfied with the default theme and color scheme of VS Code editor. They want to change the visual studio code syntax highlighting colors according to their own color choice.
The article will explain the step-by-step process for code newbies to change the color of text and syntax in VS Code. You just need to paste the given source code and change the color of any tag to syntax in the visual studio code syntax highlighting colors.
How do I change the Color of Syntax in Visual Studio?
To change the text and syntax colors in visual studio code follow the steps given below:
- Open VS Code editor to change the syntax colors.
- Go to Settings, which is in the bottom left corner of the VS Code window.
- In the search field type JSON, and click on the ‘Edit in settings.json’ option.
- Copy and paste the given source code in the settings.json, code editor tab.
- 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, if you want to change the colors.
- To change the syntax colors, follow the steps in the below video tutorials.
I have explained all the steps in the video tutorials for your understanding. You can watch the below video if your visual studio code syntax highlighting not working.
How to Change Text Color in Visual Studio Code?
Recommended for You!
- 10 Easy HTML CSS Projects for Beginners with Source Codes
- How to Run PHP Code in VSCode Terminal Console
- How to Receive Email from HTML Form using PHP
Step – 1
Open your VS Code editor and go to the settings option. The settings option is located in the bottom left corner of the Visual Studio code editor window as shown in the image below.

Step – 2
In the search field type JSON, and click on the ‘Edit in settings.json’ option. It will open a new tab where you can copy and paste the given JSON source code.

Step – 3
Source Code – How to change text color in Visual Studio code?
Now, it’s time to copy and paste the given source code into the settings.json, code editor tab. Just paste the given JSON source code in the settings.json tab window and modify this code according to the instruction given in the above video tutorial.
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"support.function.session.php",
],
"settings": {
"foreground": "#569CD6",
}
},
]
}
The below image shows, where to paste the above JSON code to modify the text and syntax of VS Code editor.

Step – 4
Modification of JSON Code to Change the Syntax Colors in VS Code
- Press ‘Ctrl+shift+P’ from the keyboard to open VS Code command palette and Search: ‘Inspect Editor Tokens and Scopes‘. As shown in the image below:

- After that, take the mouse cursor on the text or tag, you want to change the colors. And copy the line before the ‘textmate scopes’ and paste it into the Scope section of the JSON source code as shown in the image below.

- After that, paste this line into the Scope section of the JSON source code as shown in the image below.

To change the colors of multiple syntaxes repeat the above steps again.
6 Responses
Hi,
Could you show how to change color for multiple items?
Say for instance I want to have different colors for both commands, parameters etc.?
I tried adding your syntax multiple times but It’s generating errors in settings.json.
Hi, Follow the steps in the video tutorial. It will work properly!
Yes, This tutorial will work for you. You can add color code multiple times!
Yes, Please watch the video tutorial!
https://www.youtube.com/watch?v=suaqd0te9Pw
hi,
yes you can do that just copy the scop block to the end of the function.. after that add a comma and paste it again change the name of scop and the color and that’s it.
for example on the HTML page:
“editor.tokenColorCustomizations”: {
“textMateRules”: [
{
“scope”: [
“entity.other.attribute-name.html”,
],
“settings”: {
“foreground”: “#085eaf”,
},
},
{
“scope”: [
“entity.name.tag.html”,
],
“settings”: {
“foreground”: “#08af40”,
},
}
],
},
Thank you! for the explanation!