How to Automatically Change the Matching Closing Tag in Vscode

Posted by Chaitanya Shahare on Sun, Aug 20, 2023

Introduction

When you are writing HTML code in VSCode, you might have noticed that the closing tag is not changed automatically when you change the starting tag. This is because VSCode does not have this feature turned on by default. But you can enable this feature by installing an extension.

But if you don’t want to install any extension you can do in it one of the following ways.

1. User Settings

  1. Open user settings by pressing Cmd + , on Mac or Ctrl + , on Windows and Linux.
  2. Search for Editor: Linked Editing and enable it.

Linked Editing in user settings

2. Editing Settings.json

You can enable this feature by adding a few lines of code in the settings.json file.

  1. Open the settings.json file by pressing Ctrl + Shift + P and typing settings.json and pressing Enter.
  2. Add the following lines of code in the settings.json file.
  "editor.linkedEditing": true

Conclusion

It’s done, now you can change the closing tag automatically as you change the starting tag. Writing HTML is a chore and this feature will help you to write & edit HTML faster.