Bracket Pair Colorizer 2 is a free VS Code plugin to identify matching brackets with colors. This tool colorizes brackets in your code to make it easy to identify starting and ending of a block. Not only this, it even sketches vertical and horizontal scope line in the editor which is helpful. It lets you customize colors that you want to use for different brackets in your workspace. You just have to write color settings in JSON format and then it will take care of that. You install it from VS Code marketplace and then you are free to use it.
Identifying short code blocks is simple. But sometimes it becomes quite irritating to identify a block in complex code. By default, VC Code uses white colors for brackets so it is not that easy to identify a block. But when you install this extension, it will use different colors for brackets in a block. Or, you can specify what colors to use in Visual Studio Code settings file. This is an extremely simple extension and you can even use it with its default presets.
Using this Free VS Code Plugin to Identify Matching Brackets with Colours:
Bracket Pair Colorizer 2 is an open source extension for VS Code and you can find its GitHub repository here. You can install it from marketplace. Just search for it in the Extensions and it will show up. Next, install it and then you will be able to start using it.
Now, you can restart Visual Studio Code for changes to take effect. After when you open it, you will see that brackets will be colored. You can click on any bracket and the corresponding opening or closing of the bracket will be highlighted. And you can see horizontal scope line there too which indicates the exact starting and ending position in the code. You can see the screenshot below.
Now, if you want to customize the colors then you can do that. If you only want to use specific colors for brackets then you can specify that in the settings file of VS Code. In workspace, there is a settings file in which you can save configuration of VS Code extension. For example, in case of this VS Code extension, you can add the following JSON data to specify the colors to be used to colorize the brackets.
In this way, you can use this simple VS Code plugin to colorize bracket pairs. And you can easily identify same brackets with colors. Also, you can opt to draw the scop line which can be vertical or horizontal. However, vertical scope lie is not that helpful as it already there in VS Code. There are other parameters for this extension that you can tweak., And you can see them on is main page or GitHub repository.
Bracket Pair Colorizer 2 is an amazing plugin for VS Code that you can try. If you often work with complex code then you will surely find this plugin very useful. And if you have strong knowledge of VS Code plugins and then you will be able to customize it based on your requirements. So, use this simple plugin and let me know what you think about it in the comments down below.