如何禁用 VS Code 自动重命名标签/HTML 镜像功能? [英] How to disable VS Code auto-rename-tag / HTML mirror feature?

查看:218
本文介绍了如何禁用 VS Code 自动重命名标签/HTML 镜像功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够轻松地一起编辑 HTML 标签.在我看来,现在这很容易实现,所以我安装了这个

现在是内置的吗?如何禁用它?

VSCode 版本:1.41.0,提交 9579eda04fdb3a9bba2750f15193e5fafe16b959

解决方案

它已成为一个内置功能,独立于自动重命名标签扩展.如果你不喜欢它,你可以根据你安装的版本禁用它.


1.52+ 的更新

该设置现已重命名为链接编辑:

<块引用>

On Type Rename 功能,用于在匹配时编辑标签修改结束标记现在称为链接编辑.命令启用链接编辑是开始链接编辑 (⇧⌘F2) 和 Escape禁用链接编辑模式.

现在启用/禁用它的设置是:

editor.linkedEditing":true

或从用户界面:


1.44+ 更新

他们更改了镜像光标功能,现在将其称为
(复制自 VS Code 1.44 发行说明)

在 HTML 标签上激活时,如果开始和结束标签都变为同步",则更改一个也会更改另一个.该功能在默认情况下处于禁用状态,您可以明确执行 On Type Rename Symbol 命令或将 editor.renameOnType 设置为 true.

通过此更改,1.41 中引入的 html.mirrorCursorOnMatchingTag 现在将显示为已弃用(或变灰).


1.42+ 更新

html.mirrorCursorOnMatchingTag 现在默认禁用,从

通过 settings.json:

html.mirrorCursorOnMatchingTag":假,

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 extension, and it turned out to be not useful for me: instead of helping me in html/jsx code editing, it breaks everything and I have to undo what it does and try to edit the thing to avoid triggering it.

The logical thing here would obviously be to remove this extension from my system. The only problem here, however, is that I can't seem to do that - I've uninstalled it, even reinstalled VS Code, tried VS Code Insiders, but here it is, still enabled:

Is it built-in now? How do I disable it?

VSCode version: 1.41.0, commit 9579eda04fdb3a9bba2750f15193e5fafe16b959

解决方案

It has become a built-in feature, separate from the Auto Rename Tag extension. If you don't like it, you can disable it depending on which version you've got installed.


Update for 1.52+

The setting has now been renamed to Linked Editing:

The On Type Rename feature for editing a tag when its matching closing tag is modified is now called linked editing. The command to enable linked editing is Start Linked Editing (⇧⌘F2) and Escape disables linked editing mode.

The setting to enable/disable it is now:

"editor.linkedEditing": true 

Or from the UI:


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 introduced in 1.41 will now show up as deprecated (or grayed-out).


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.


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,

这篇关于如何禁用 VS Code 自动重命名标签/HTML 镜像功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆