SUBLIME TEXT 3 – WRAPPING SELECTION IN TAGS

Posted on at


As a front-end web developer, something I seem to end up doing a lot of times is wrapping individual lines, or wrapping a section of code with HTML tags.

For example, I might have received a text document from a client with copy for their website and I need to wrap the supplied content in the relevant HTML tags, so fairly basic stuff like <p> tags or list of menu items with <ul>/<li>structure.

Doing this one item at a time gets old really quick, so I looked into any possible shortcuts that I could use in Sublime Text (my current code editor of choice) to make this process both easier and quicker.

If you’re just wrapping a single line of code then all you need to do is as follow (Mac controls):

• Select all text
• ctrl + shift + W
• Overtype the default <p> tag with whatever you like

If you’re wanting to wrap multiple line each with their own tag then you’ll need to do the following (Mac controls):

• Select all text
• cmd + shift + L
• ctrl + shift + W
• Overtype the default <p> tag with whatever you like.



About the author

Stvnrlnd

Designer \\ Web Enthusiast \\ Self-Proclaimed Nerd

Subscribe 0
160