5

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.

Jason
  • 15,017
  • 23
  • 85
  • 116
MrPizzaFace
  • 7,807
  • 15
  • 79
  • 123

6 Answers6

10

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

Sergey Chikuyonok
  • 2,626
  • 14
  • 13
7

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

Mikkel Winther
  • 567
  • 1
  • 4
  • 10
3

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" }
]
Tonatio
  • 4,026
  • 35
  • 24
1

Here are some solutions which does not require any plugins. All solutions works on sublime2, sublime3 and atom

Using Multiple Cursors (press shift-alt and down arrow)

  • enter image description here

Using Ctrl-D (if you want to restrict the update to some elements only)

  • enter image description here

Using ALT-F3 (to update all instances of h2 -> p)

  • enter image description here

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

Harry
  • 1,572
  • 2
  • 17
  • 31
0

If you have emmet installed: Cmd+Shift+K on mac, Ctrl+Shift+ on windows

jberg7777
  • 341
  • 3
  • 6
-1

Just use regexp. They are supported by Sublime Text 2 (in the CTRL + H).

Artur
  • 384
  • 1
  • 7
  • Thank you, I was about to edit my question just to say without a regex. I want something that will automatically update the closing tag if I change the open tag. – MrPizzaFace Feb 23 '14 at 00:06