[英]Automatically update the closing tag when open tag changes with Sublime Text 2 on Mac OS X
See the H2
tags?看到
H2
标签了吗? How can I change them all to p
tags without manually going from line to line.如何将它们全部更改为
p
标签,而无需手动从一行到另一行。 cmd+d
is not viable because of the varying lengths of the inner content. cmd+d
不可行,因为内部内容的长度不同。
I found something called Emmet Plugin which I installed but can't get it to work.我找到了一个叫做Emmet Plugin 的东西,我安装了它但无法让它工作。 (Followed steps and confused by docs http://docs.emmet.io/actions/go-to-pair/ ).
(遵循步骤并被文档http://docs.emmet.io/actions/go-to-pair/混淆)。
Thanks for the help.谢谢您的帮助。
--UPDATE-- - 更新 -
Not using a regex.不使用正则表达式。 Just to clarify I want something that will automatically update the
closing tag
if I change the open tag
.只是为了澄清我想要一些东西,如果我改变了
open tag
,它会自动更新closing tag
open tag
。
您需要“重命名标签”操作: https : //github.com/sergeche/emmet-sublime#available-actions
Alt + F3 works for me. Alt + F3 对我有用。 I'm using the Emmet plugin, though.
不过,我正在使用 Emmet 插件。
I use Emmet and CTRL + SHIFT + ' does not work for me.我使用 Emmet 并且CTRL + SHIFT + '对我不起作用。
I changed the key shortcut of the command.我更改了命令的快捷键。
Preferences -> Key Bindings -> User
Content:内容:
[
{ "keys": ["ctrl+shift+;"], "command": "rename_tag" }
]
Here are some solutions which does not require any plugins.以下是一些不需要任何插件的解决方案。 All solutions works on sublime2, sublime3 and atom
所有解决方案都适用于 sublime2、sublime3 和 atom
PS: For those who does not have the tags in same line, of they do have then all the contents are of different number of lines method 1 will not work both other methods will still work PS:对于那些在同一行中没有标签的人,如果他们有那么所有内容的行数不同方法1将不起作用,其他方法仍然有效
如果您安装了emmet :Mac 上为Cmd+Shift+K ,Windows 上为Ctrl+Shift+
Just use regexp.只需使用正则表达式。 They are supported by Sublime Text 2 (in the CTRL + H).
它们由 Sublime Text 2(在 CTRL + H 中)支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.