diff --git a/Add Line with Smart List.sublime-macro b/Add Line with Smart List.sublime-macro new file mode 100644 index 0000000..a13b1cf --- /dev/null +++ b/Add Line with Smart List.sublime-macro @@ -0,0 +1,4 @@ +[ + {"command": "move_to", "args": {"to": "hardeol"}}, + {"command": "smart_list"} +] diff --git a/Default.sublime-keymap b/Default.sublime-keymap index 28a78b4..62fcdff 100644 --- a/Default.sublime-keymap +++ b/Default.sublime-keymap @@ -15,6 +15,12 @@ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*([-+\\**]|\\d+\\.+)\\s+" } ] }, + { "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/SmartMarkdown/Add Line with Smart List.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*([-+\\**\\>\\|%]+|[(]?\\d+[.)]+)\\s+" } + ] + }, { "keys": ["enter"], "command": "smart_list", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, @@ -68,5 +74,20 @@ [ {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} ] + }, + { "keys": ["tab"], "command": "indent", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*([-\\+\\*]|#\\.|(\\d+|[A-z]|[IVXLCDM]+|[ivxlcdm]+)[\\.\\)]|\\((\\d+|[A-z]|[IVXLCDM]+|[ivxlcdm]+)\\)|\\(\\@[\\w\\-]*\\))\\s+" } + ] + }, + { "keys": ["shift+tab"], "command": "unindent", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*([-\\+\\*]|#\\.|(\\d+|[A-z]|[IVXLCDM]+|[ivxlcdm]+)[\\.\\)]|\\((\\d+|[A-z]|[IVXLCDM]+|[ivxlcdm]+)\\)|\\(\\@[\\w\\-]*\\))\\s+" } + // Should we enable the following setting check? + // { "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true } + ] } ]