How to disable VS Code auto-rename-tag / HTML mirror feature?

后端 未结 2 985
甜味超标
甜味超标 2021-01-03 20:14

I wanted to be able to easily edit HTML tags together. It seemed to me like this is such an easy thing to implement nowadays, so I\'ve installed this auto-rename-tag extensi

相关标签:
2条回答
  • 2021-01-03 20:50

    Original Answer for 1.41

    It's now a built-in feature starting 1.41.

    HTML mirror cursor
    https://code.visualstudio.com/updates/v1_41#_html-mirror-cursor

    VS Code now adds a "mirror cursor" when you are editing HTML tags. This behavior is controlled by the setting html.mirrorCursorOnMatchingTag, which is on by default.

    This feature works by adding a multi-cursor to the matching tag when your cursor moves into an HTML tag name range. Just like in multi-cursor mode, you can use word-wise deletion or word-wise selection. The mirrored cursor is removed when you move your cursor outside the tag name range.

    Basically, selecting either the tag start or the tag end puts 2 cursors on each, so editing one also edits the other. It is enabled by default.

    You can explicitly disable it from your settings.

    Via UI:

    Via settings.json:

    "html.mirrorCursorOnMatchingTag": false,
    

    Update for 1.42

    The html.mirrorCursorOnMatchingTag is now disabled by default starting in 1.42.
    See this other answer for the quotation from the release notes.


    Update for 1.44

    They changed the mirror cursor feature and are now calling it Synced Regions.


    (copied from the VS Code 1.44 release notes)

    When activated on HTML tags, if both start and end tags become "synced", then changing one also changes the other. The feature is disabled by default though, and either you explicitly execute the On Type Rename Symbol command or set the editor.renameOnType setting to true.

    With this change, the html.mirrorCursorOnMatchingTag will now show up as deprecated (or grayed-out).

    0 讨论(0)
  • 2021-01-03 21:13

    See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_42.md#html-mirror-cursor-off-by-default with v1.42 due out early February, 2020.

    HTML Mirror Cursor off by default

    We have made Mirror Cursor an opt-in feature. In the upcoming iteration, we'll continue to improve its implementation to make this feature more easily understandable and available to more languages. You can still use this feature by turning on html.mirrorCursorOnMatchingTag.

    ----- Update March 2020 ----------

    The vscode devs have heard you. The mirror cursor functionality is being substantially modified. You can test it in the Insiders' Build now so perhaps it'll get into v1.44 or soon thereafter.

    Especially pasting into a tag has been much improved. And no dual cursors. See https://github.com/microsoft/vscode/issues/88424#issuecomment-600840619

    And release notes: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_44.md#synced-regions It is in v1.44.

    0 讨论(0)
提交回复
热议问题