Header

Sublime shortcut to wrap selected text in a tag

This is a super-useful Sublime shortcut that's worth tattooing on your arm. 

Ctr-Shift-W (Mac OSX) 

or

Alt-Shift-W (Windows)

 

  1. Simply select the text you want to wrap with a tag

    sublime wrap selection tag 1


  2. Hit Ctl-Shift-W (Mac OSX) or Alt-Shift-W (Windows)

    how to wrap text with a tag in Sublime

    By default, this will add <p> </p> tags around your selection


  3. Immediately hit <delete>, this will remove the p from <p> tags, leaving just the angle brackets

    sublime wrap selection with an HTML tag


  4. Enter your new HTML element, it will automatically be added to both the opening and closing tag

    how to add a tag in sublime text editor


  5. That's it!
Pas de connexion Internet