Search code examples
htmlsublimetextsublimetext3sublime-text-plugin

Command to convert selected lines to HTML bulleted list in Sublime Text?


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:

  1. Select the lines
  2. Use "split selection into lines (shift-command-L)
  3. Wrap selection with tag (ctrl-W) and type LI
  4. Re-select the 4 lines
  5. Wrap selection again with 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?


Solution

  • If you are using a mac:

    • Shift+Cmd+P: Command Palette
    • Filter the list with "wrap with abb"
    • Notice the input box at the bottom of the window
    • Type and enter: ul>li*

    Also, one can select the text and press Ctrl+W and use ul>li*