Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically update the closing tag when open tag changes with Sublime Text 2 on Mac OS X

enter image description here

See the H2 tags? How can I change them all to p tags without manually going from line to line. cmd+d is not viable because of the varying lengths of the inner content.

I found something called Emmet Plugin which I installed but can't get it to work. (Followed steps and confused by docs 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.

like image 480
MrPizzaFace Avatar asked Feb 22 '14 23:02

MrPizzaFace


3 Answers

You need “Rename Tag” action: https://github.com/sergeche/emmet-sublime#available-actions

like image 102
Sergey Chikuyonok Avatar answered Sep 24 '22 13:09

Sergey Chikuyonok


Alt + F3 works for me. I'm using the Emmet plugin, though.

like image 20
Mikkel Winther Avatar answered Sep 23 '22 13:09

Mikkel Winther


I use Emmet and CTRL+SHIFT+' does not work for me.

I changed the key shortcut of the command.

Preferences -> Key Bindings -> User

Content:

[
    { "keys": ["ctrl+shift+;"], "command": "rename_tag" }
]
like image 28
Tonatio Avatar answered Sep 25 '22 13:09

Tonatio