Sublime Forum

Automatically add list item

#1

Hi, newbie question here. When creating a long list, it’s a pain to have to type in the

  • tag at the beginning of each list item. Is it possible to set thing up so that a new li tag pair appears automatically after hitting ENTER at the completion of the previous list item?
  • 0 Likes

    #2

    So I guess I should have done more searching before posting here because I found this answer: https://superuser.com/questions/609057/how-do-i-assign-a-keyboard-shortcut-to-recorded-macro-in-sublime-text

    So what I did was record a macro at the end of a list item text entry: >>>>>[RETURN]<li[RETURN] and saved it as Add List Item. Then I created a user key shortcut from the Preferences/Keybinding menu that allows me to launch the macro using Alt+Command+l key combination. The keymap entry is as follows:

    [
    { “keys”: [“command+alt+l”], “command”: “run_macro_file”, “args”: {“file”: “Packages/User/Add List Item.sublime-macro”} }
    ]

    1 Like