Visual studio code: how to automatically change the matching closing tag

Since VSCode 1.44, you can enable automatic updating of matching tags like this:

  1. Go to File menu, Preferences and Settings
  2. Search for editor.linkedEditing
  3. Enable "Linked Editing"

Screenshot of Linked Editing setting

Here is an example of how it works:

Example of linked editing


Start VS Code, go to Plugins and search for Auto Rename Tag. Install, reload, done. This plugin: https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag


As mentioned by @TwistedSim, you can achieve this using Ctrl + D


You can use the Rename Symbol command to do this.

  1. Select (or click to put the caret anywhere inside) the opening tag
  2. Hit F2
  3. Enter the new tag name and press Enter

Opening and closing tags will both be renamed.

Alternatively, you can press Shift + Enter at step 3 to preview changes and then Shift + Enter again to apply them.