Configuring VSCode Colorized Brackets
Tags: vscode, productivity, tooling, functional
Published: 2021-12-31 14:32:31

## Overview

Most of us likely still remember that initial feeling of amazement after installing the the wildly popular but now deprecated [Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer) extension by [CoenraadS](https://marketplace.visualstudio.com/publishers/CoenraadS). After over 10M+ downloads, the options once delivered by that extension have now become native features in VS Code. 

At first, I found it difficult to achieve the same level of comfort and functionality offered by Bracket Pair Colorizer. And judging from the nearly [100 issues](https://github.com/microsoft/vscode/issues?q=is%3Aissue+bracket+colorization) opened on GitHub, I was not alone. That said, the VS Code team has changed my impression with their [latest feature update](https://code.visualstudio.com/updates/v1_62#_editor) this past October.

---

[![editor.guides.highlightActiveIndentation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68otksnjnsmlkeg9e4js.jpg)](https://code.visualstudio.com/updates/v1_62) <figcaption>Vertical lines now depend on the indentation of the code that is surrounded by the bracket pair. (Image: Microsoft)</figcaption>

---

## Discover What's New

I will cover each of the aforementioned updates briefly before sharing the configuration I am now using in VS Code. So without further ado, let's check out these new features! 😎

### Bracket Pairs

- Indentation of bracket characters can now be customized based on the programming language being used. 

- Colorization of bracket characters can now be defined based on functionality which is inferred from the depth of nesting.

### Bracket Pair Guides

- Horizontal lines now outline the scope of a bracket pair.

- Vertical lines now depend on how the code within the bracket pair is indented.

- Bracket pair guides now have a third option, 'active', providing a more granular level of control over colorized highlights.

- 🎉 Guide highlights now support color customizations! 🎉

## Custom Settings Example

Now that we have an idea of the possibilities, here is a working example, copied from my `settings.json` as promised. It has been freshly revised to take advantage of the new updates.

---

{% gist https://gist.github.com/killshot13/8a3489d59fd812b97bfc81ab9c17fec6 %}<figcaption>The relevant changes made to the `settings.json` file.</figcaption>

---

![Sample Code w/ Colorized Brackets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kizqmty89gpgdlb6xt0m.jpg)<figcaption>Shows these settings applied to brackets in different languages.</figcaption>

---

## Conclusion

You now have a good starting point for creating a customized bracket pair colorization that works well for you. Of course, I was not able to cover every setting and variable in this short article. 

There are many options which you can enable or disable to optimize your VS Code experience. Remember you can always reference the [default settings](https://code.visualstudio.com/docs/getstarted/settings#_default-settings) in case your `settings.json` file is or becomes a bit disorganized.

I'm excited to see the configurations and themes you all create using these new feature, so please leave a screenshot or code snippet in the comments.

Don't forget to 💖 this article and if you're feeling extra generous, please click my name below to 🎆subscribe🎇!

  -- killshot13

---

{% user killshot13 %}