In visual studio code when changing the start tag type (e.g., from <div>
to <span>
) I want the editor to automatically change the matching closing tag. How can I do that?
File > Preferences > Keymaps, Search 'Auto close' and click on install. If it doesn't work, reload the plugin.
If it does not work properly after this setting, the default VSCode HTML completion may be conflicting. First, go to the Settings and search for "HTML: Auto Closing Tags" and uncheck the setting that is checked by default.
To select multiple carets, click or make first text selection as usual, and then press Ctrl+Alt while you click or select text in each additional location. You can also automatically add matching text as additional selections, or select a box of text to edit identically on each line.
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
You can use the Rename Symbol command to do this.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With