Reputation: 14922
Whenever I have a series of lines that are supposed to be a bulleted list (UL) in Sublime Text 3, I need to repeat these steps:
LI
UL
this time (or just manually type UL and /UL)This is tedious. Does anyone know of a built-in command, a plug-in, or a macro that will take selected lines, wrap each line with an LI tag and the selection with the UL tags in one go?
Upvotes: 6
Views: 10857
Reputation: 66
If you are using a mac:
Also, one can select the text and press Ctrl+W and use ul>li*
Upvotes: 5
Reputation: 608
You can easily achieve this if you have the Emmet plugin installed. The feature that you're after is called "Wrap with abbreviation".
Steps needed:
It's also possible to do some further cool stuff using filters with this as well. Be sure to check out the Emmet docs.
Upvotes: 14
Reputation: 3923
Use multiline select to insert </li><li>
before every line. Remove all line breaks and add a line break after every </li>
. Then manually wrap the result in <ul></ul>
. It should work and look okay to the eye.
Or use the Emmet plugin to make a list like this: ul>li*40
, press ctrl+e
or tab
, and multiline-select copypaste the desired text to <li>here</li>
.
Upvotes: 1