I totally missed that in 2019, the F2
key was enabled to rename HTML tags, but it does: [Wayback/Archive.is] Select matching element/rename HTML tag in Visual Studio Code – Stack Overflow:
V1.41 is adding this functionality, see [Wayback/Archive.is] github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_41.md#html-rename-tagsHTML rename tagsYou can now use F2 to rename the opening/closing tag pairs in HTML.F2 when the cursor is over one of the tags and you will get a little input box with the cursor to input the new tag name and the start/end tags will be replaced with whatever you type upon .
[Wayback/Archive.is] Another answer indicates that even more recently, Linked Editing can do the same without even pressing F2
. Too bad it is not enabled by default:
No need for extension, this is now cooked into VSCode."editor.linkedEditing": true
–jeroen