Last Updated: February 25, 2016
·
742
· jonginn

Sublime Wrap Tags Rebind

Quick tip:

Sublime Text 2 has a 'Wrap Tags' function but it's hidden behind a convoluted shortcut (Alt+Shift+T). You could use that, but here's how you can make your own shortcut for easy access.

Open up "Key Bindings - User". Add the following code.

{ "keys": ["ctrl+t"], "command": "insert_snippet", "args": { "name": "Packages/XML/long-tag.sublime-snippet" } }

Highlight your HTML code, press Ctrl+T, and it'll wrap tags around. Then simply type your tag name and it'll edit both sides.

Voila!

For Mac types who want to use CMD+T, just replace 'ctrl' with 'super'.