diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap
index 61c38152..a11e4d49 100644
--- a/Default (Linux).sublime-keymap
+++ b/Default (Linux).sublime-keymap
@@ -480,7 +480,7 @@
{ "key": "following_text", "operator": "regex_contains", "operand": "^#+\\s\\S", "match_all": true }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -490,7 +490,27 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -500,7 +520,17 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -510,7 +540,17 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -525,6 +565,7 @@
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\-+$|^\\=+$", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }
]
},
@@ -700,12 +741,31 @@
]
},
// Add line to current list item
- { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context":
+ { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }
]
},
+ // Add line to current GFM task
+ { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
// Extend lists (also in block quotes)
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
[
@@ -714,6 +774,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -721,6 +788,13 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Extend lists with GFM tasks (also in block quotes)
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
[
@@ -729,6 +803,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -736,6 +817,13 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Extend Numbered Lists (also in block quotes)
{ "keys": ["enter"], "command": "mde_number_list", "context":
[
@@ -744,6 +832,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_number_list", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "mde_number_list", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -751,8 +846,23 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_number_list", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Remove empty list item including GFM tasks
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
@@ -760,7 +870,7 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
@@ -768,7 +878,15 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s?$", "match_all": true },
@@ -803,7 +921,7 @@
// Hitting "tab" directly after new list bullet should insert \t otherwise
{ "keys": ["tab"], "command": "mde_indent_list_item", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "has_next_field", "operator": "equal", "operand": false },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
@@ -814,12 +932,11 @@
// Indent list item if caret is behind bullets
{ "keys": ["tab"], "command": "mde_indent_list_item", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "has_next_field", "operator": "equal", "operand": false },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
- { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s*$", "match_all": true },
- { "key": "following_text", "operator": "not_regex_match", "operand": "(?:-{2,}|={2,}|[+*])", "match_all": true }
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s+$", "match_all": true }
]
},
// Indent selected list items
@@ -891,63 +1008,94 @@
// Quotes
//
- // Convert to blockquote
- { "keys": [">"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Convert to Blockquote.sublime-macro"}, "context":
+ // Extend blockquote (ignore headings, lists and tasks)
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
- { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- // Extend blockquote (ignore headings, lists and tasks)
- { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context":
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context":
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- // Remove empty blockquote line
- // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
- // [
- // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true },
- // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
- // { "key": "auto_complete_visible", "operator": "equal", "operand": false }
- // ]
- // },
- // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
- // [
- // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true },
- // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
- // { "key": "setting.auto_complete_commit_on_tab" }
- // ]
- // },
- { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
+ // Terminate blockquote
+ { "keys": ["ctrl+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }
+ ]
+ },
+ { "keys": ["ctrl+keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }
+ ]
+ },
+ // Terminate empty blockquote
+ { "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ ]
+ },
+ { "keys": ["ctrl+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ ]
+ },
+ // Decrease block quote level
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)*(>\\s?)$", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s$", "match_all": true }
+ ]
+ },
+ // Decrease block quote level and trim whitespace after caret
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s?$", "match_all": true },
{ "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }
]
},
- // Indent blockquote
+ // Convert to or increase block quote level (selected text)
+ { "keys": [">"], "command": "mde_indent_quote", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
+ ]
+ },
+ // Increase block quote level
{ "keys": ["ctrl+shift+."], "command": "mde_indent_quote", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true }
]
},
- // Unindent blockquote
+ // Decrease block quote level
{ "keys": ["ctrl+shift+,"], "command": "mde_unindent_quote", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true },
- { "key": "preceding_text", "operator": "regex_contains", "operand": "(> )+", "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(> )+", "match_all": true }
]
},
@@ -1008,6 +1156,13 @@
{ "key": "auto_complete_visible", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true },
+ { "key": "auto_complete_visible", "operand": false }
+ ]
+ },
// extend numbered reference if auto-completions are commited via tab only
{ "keys": ["enter"], "command": "mde_add_numbered_reference_definition", "context":
[
@@ -1016,11 +1171,11 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- // jump to reference
- { "keys": ["ctrl+alt+g"], "command": "mde_reference_jump", "context":
+ { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true },
- { "key": "setting.mde.keymap_disable.reference_jump", "operator": "not_equal", "operand": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
]
},
// organize references
@@ -1030,6 +1185,28 @@
{ "key": "setting.mde.keymap_disable.reference_organize", "operator": "not_equal", "operand": true }
]
},
+ // jump to reference
+ { "keys": ["f12"], "command": "mde_reference_jump", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+f12"], "command": "mde_reference_jump", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.markdown entity.name.reference.link", "match_all": true }
+ ]
+ },
+ // jump to footnote
+ { "keys": ["f12"], "command": "mde_magic_footnotes", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.footnote", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+f12"], "command": "mde_magic_footnotes", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.footnote entity.name.reference.link", "match_all": true }
+ ]
+ },
//
// CriticMarkup
@@ -1048,6 +1225,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Addition.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.addition", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard addition
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Addition.sublime-macro"}, "context":
[
@@ -1075,6 +1258,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true },
@@ -1103,6 +1292,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Deletion.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.deletion", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard deletion
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Deletion.sublime-macro"}, "context":
[
@@ -1132,6 +1327,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true },
@@ -1160,6 +1361,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Substitution.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.substitution", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard substitution
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Substitution.sublime-macro"}, "context":
[
diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap
index 19ad69ae..a833ed5a 100644
--- a/Default (OSX).sublime-keymap
+++ b/Default (OSX).sublime-keymap
@@ -438,13 +438,13 @@
{ "key": "setting.mde.keymap_disable.set_heading_level", "operand": false }
]
},
- { "keys": ["ctrl+alt+."], "command": "mde_change_headings_level", "args": {"by": 1}, "context":
+ { "keys": ["super+alt+."], "command": "mde_change_headings_level", "args": {"by": 1}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "setting.mde.keymap_disable.set_heading_level", "operand": false }
]
},
- { "keys": ["ctrl+alt+,"], "command": "mde_change_headings_level", "args": {"by": -1}, "context":
+ { "keys": ["super+alt+,"], "command": "mde_change_headings_level", "args": {"by": -1}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "setting.mde.keymap_disable.set_heading_level", "operand": false }
@@ -480,7 +480,7 @@
{ "key": "following_text", "operator": "regex_contains", "operand": "^#+\\s\\S", "match_all": true }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -490,7 +490,27 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -500,7 +520,17 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -510,7 +540,17 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -525,6 +565,7 @@
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\-+$|^\\=+$", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }
]
},
@@ -700,12 +741,31 @@
]
},
// Add line to current list item
- { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context":
+ { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }
]
},
+ // Add line to current GFM task
+ { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
// Extend lists (also in block quotes)
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
[
@@ -714,6 +774,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -721,6 +788,13 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Extend lists with GFM tasks (also in block quotes)
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
[
@@ -729,6 +803,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -736,6 +817,13 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Extend Numbered Lists (also in block quotes)
{ "keys": ["enter"], "command": "mde_number_list", "context":
[
@@ -744,6 +832,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_number_list", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "mde_number_list", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -751,8 +846,23 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_number_list", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Remove empty list item including GFM tasks
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
@@ -760,7 +870,7 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
@@ -768,7 +878,15 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s?$", "match_all": true },
@@ -803,7 +921,7 @@
// Hitting "tab" directly after new list bullet should insert \t otherwise
{ "keys": ["tab"], "command": "mde_indent_list_item", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "has_next_field", "operator": "equal", "operand": false },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
@@ -814,12 +932,11 @@
// Indent list item if caret is behind bullets
{ "keys": ["tab"], "command": "mde_indent_list_item", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "has_next_field", "operator": "equal", "operand": false },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
- { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s*$", "match_all": true },
- { "key": "following_text", "operator": "not_regex_match", "operand": "(?:-{2,}|={2,}|[+*])", "match_all": true }
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s+$", "match_all": true }
]
},
// Indent selected list items
@@ -891,63 +1008,94 @@
// Quotes
//
- // Convert to blockquote
- { "keys": [">"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Convert to Blockquote.sublime-macro"}, "context":
+ // Extend blockquote (ignore headings, lists and tasks)
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
- { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- // Extend blockquote (ignore headings, lists and tasks)
- { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context":
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context":
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- // Remove empty blockquote line
- // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
- // [
- // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true },
- // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
- // { "key": "auto_complete_visible", "operator": "equal", "operand": false }
- // ]
- // },
- // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
- // [
- // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true },
- // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
- // { "key": "setting.auto_complete_commit_on_tab" }
- // ]
- // },
- { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
+ // Terminate blockquote
+ { "keys": ["super+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }
+ ]
+ },
+ { "keys": ["super+keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }
+ ]
+ },
+ // Terminate empty blockquote
+ { "keys": ["super+enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ ]
+ },
+ { "keys": ["super+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ ]
+ },
+ // Decrease block quote level
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)*(>\\s?)$", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s$", "match_all": true }
+ ]
+ },
+ // Decrease block quote level and trim whitespace after caret
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s?$", "match_all": true },
{ "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }
]
},
- // Indent blockquote
+ // Convert to or increase block quote level (selected text)
+ { "keys": [">"], "command": "mde_indent_quote", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
+ ]
+ },
+ // Increase block quote level
{ "keys": ["super+shift+."], "command": "mde_indent_quote", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true }
]
},
- // Unindent blockquote
+ // Decrease block quote level
{ "keys": ["super+shift+,"], "command": "mde_unindent_quote", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true },
- { "key": "preceding_text", "operator": "regex_contains", "operand": "(> )+", "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(> )+", "match_all": true }
]
},
@@ -1008,6 +1156,13 @@
{ "key": "auto_complete_visible", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true },
+ { "key": "auto_complete_visible", "operand": false }
+ ]
+ },
// extend numbered reference if auto-completions are commited via tab only
{ "keys": ["enter"], "command": "mde_add_numbered_reference_definition", "context":
[
@@ -1016,11 +1171,11 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- // jump to reference
- { "keys": ["super+ctrl+shift+l"], "command": "mde_reference_jump", "context":
+ { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true },
- { "key": "setting.mde.keymap_disable.reference_jump", "operator": "not_equal", "operand": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
]
},
// organize references
@@ -1030,6 +1185,28 @@
{ "key": "setting.mde.keymap_disable.reference_organize", "operator": "not_equal", "operand": true }
]
},
+ // jump to reference
+ { "keys": ["f12"], "command": "mde_reference_jump", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+f12"], "command": "mde_reference_jump", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.markdown entity.name.reference.link", "match_all": true }
+ ]
+ },
+ // jump to footnote
+ { "keys": ["f12"], "command": "mde_magic_footnotes", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.footnote", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+f12"], "command": "mde_magic_footnotes", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.footnote entity.name.reference.link", "match_all": true }
+ ]
+ },
//
// CriticMarkup
@@ -1048,6 +1225,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Addition.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.addition", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard addition
{ "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Addition.sublime-macro"}, "context":
[
@@ -1075,6 +1258,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
{ "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true },
@@ -1103,6 +1292,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Deletion.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.deletion", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard deletion
{ "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Deletion.sublime-macro"}, "context":
[
@@ -1132,6 +1327,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
{ "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true },
@@ -1160,6 +1361,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Substitution.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.substitution", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard substitution
{ "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Substitution.sublime-macro"}, "context":
[
diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap
index 61c38152..a11e4d49 100644
--- a/Default (Windows).sublime-keymap
+++ b/Default (Windows).sublime-keymap
@@ -480,7 +480,7 @@
{ "key": "following_text", "operator": "regex_contains", "operand": "^#+\\s\\S", "match_all": true }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -490,7 +490,27 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -500,7 +520,17 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -510,7 +540,17 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
+ { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true },
@@ -525,6 +565,7 @@
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\-+$|^\\=+$", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }
]
},
@@ -700,12 +741,31 @@
]
},
// Add line to current list item
- { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context":
+ { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }
]
},
+ // Add line to current GFM task
+ { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }
+ ]
+ },
// Extend lists (also in block quotes)
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
[
@@ -714,6 +774,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -721,6 +788,13 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Extend lists with GFM tasks (also in block quotes)
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
[
@@ -729,6 +803,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -736,6 +817,13 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Extend Numbered Lists (also in block quotes)
{ "keys": ["enter"], "command": "mde_number_list", "context":
[
@@ -744,6 +832,13 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_number_list", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
{ "keys": ["enter"], "command": "mde_number_list", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
@@ -751,8 +846,23 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_number_list", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
// Remove empty list item including GFM tasks
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
@@ -760,7 +870,7 @@
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
@@ -768,7 +878,15 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context":
+ { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s?$", "match_all": true },
@@ -803,7 +921,7 @@
// Hitting "tab" directly after new list bullet should insert \t otherwise
{ "keys": ["tab"], "command": "mde_indent_list_item", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "has_next_field", "operator": "equal", "operand": false },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
@@ -814,12 +932,11 @@
// Indent list item if caret is behind bullets
{ "keys": ["tab"], "command": "mde_indent_list_item", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "has_next_field", "operator": "equal", "operand": false },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
- { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s*$", "match_all": true },
- { "key": "following_text", "operator": "not_regex_match", "operand": "(?:-{2,}|={2,}|[+*])", "match_all": true }
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s+$", "match_all": true }
]
},
// Indent selected list items
@@ -891,63 +1008,94 @@
// Quotes
//
- // Convert to blockquote
- { "keys": [">"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Convert to Blockquote.sublime-macro"}, "context":
+ // Extend blockquote (ignore headings, lists and tasks)
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
- { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- // Extend blockquote (ignore headings, lists and tasks)
- { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context":
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
- { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context":
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
+ ]
+ },
+ { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true },
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- // Remove empty blockquote line
- // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
- // [
- // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true },
- // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
- // { "key": "auto_complete_visible", "operator": "equal", "operand": false }
- // ]
- // },
- // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
- // [
- // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true },
- // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
- // { "key": "setting.auto_complete_commit_on_tab" }
- // ]
- // },
- { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context":
+ // Terminate blockquote
+ { "keys": ["ctrl+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }
+ ]
+ },
+ { "keys": ["ctrl+keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }
+ ]
+ },
+ // Terminate empty blockquote
+ { "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ ]
+ },
+ { "keys": ["ctrl+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
+ ]
+ },
+ // Decrease block quote level
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
- { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)*(>\\s?)$", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s$", "match_all": true }
+ ]
+ },
+ // Decrease block quote level and trim whitespace after caret
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty Blockquote.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s?$", "match_all": true },
{ "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }
]
},
- // Indent blockquote
+ // Convert to or increase block quote level (selected text)
+ { "keys": [">"], "command": "mde_indent_quote", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
+ ]
+ },
+ // Increase block quote level
{ "keys": ["ctrl+shift+."], "command": "mde_indent_quote", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true }
]
},
- // Unindent blockquote
+ // Decrease block quote level
{ "keys": ["ctrl+shift+,"], "command": "mde_unindent_quote", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true },
- { "key": "preceding_text", "operator": "regex_contains", "operand": "(> )+", "match_all": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(> )+", "match_all": true }
]
},
@@ -1008,6 +1156,13 @@
{ "key": "auto_complete_visible", "operand": false }
]
},
+ { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true },
+ { "key": "auto_complete_visible", "operand": false }
+ ]
+ },
// extend numbered reference if auto-completions are commited via tab only
{ "keys": ["enter"], "command": "mde_add_numbered_reference_definition", "context":
[
@@ -1016,11 +1171,11 @@
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
- // jump to reference
- { "keys": ["ctrl+alt+g"], "command": "mde_reference_jump", "context":
+ { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context":
[
- { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true },
- { "key": "setting.mde.keymap_disable.reference_jump", "operator": "not_equal", "operand": true }
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true },
+ { "key": "setting.auto_complete_commit_on_tab" }
]
},
// organize references
@@ -1030,6 +1185,28 @@
{ "key": "setting.mde.keymap_disable.reference_organize", "operator": "not_equal", "operand": true }
]
},
+ // jump to reference
+ { "keys": ["f12"], "command": "mde_reference_jump", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+f12"], "command": "mde_reference_jump", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.markdown entity.name.reference.link", "match_all": true }
+ ]
+ },
+ // jump to footnote
+ { "keys": ["f12"], "command": "mde_magic_footnotes", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.footnote", "match_all": true }
+ ]
+ },
+ { "keys": ["shift+f12"], "command": "mde_magic_footnotes", "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.footnote entity.name.reference.link", "match_all": true }
+ ]
+ },
//
// CriticMarkup
@@ -1048,6 +1225,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Addition.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.addition", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard addition
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Addition.sublime-macro"}, "context":
[
@@ -1075,6 +1258,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true },
@@ -1103,6 +1292,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Deletion.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.deletion", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard deletion
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Deletion.sublime-macro"}, "context":
[
@@ -1132,6 +1327,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true },
@@ -1160,6 +1361,12 @@
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
]
},
+ { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Substitution.sublime-macro"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.substitution", "match_all": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false }
+ ]
+ },
// discard substitution
{ "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Substitution.sublime-macro"}, "context":
[
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md
index bfab73fe..bacaa6e4 100644
--- a/docs/troubleshooting.md
+++ b/docs/troubleshooting.md
@@ -6,36 +6,44 @@
MarkdownEditing stores settings in _Preferences.sublime-settings_ as of version 3.0.0.
-Thus all user specific syntax specific settings or overrides can or must be removed:
+The reasons/benefits are:
+
+1. All settings can be set globally, per project, per syntax or per view.
+2. It is easier to add syntax specific settings than to override them.
+3. ST's distraction free mode already provides a good writer mode out of the box.
+
+This change however requires some manual work to...
+
+1. clean up syntax specific user overrides for those who tried to eliminate
+ MarkdownEditing's visual changes.
+2. restore syntax specific settings for those who want them back.
+
+To clean up or restore syntax specific settings...
1. Open a Markdown file
2. Open Command Palette ctrl+shift+p
3. Execute `Preferences: Settings - Syntax Specific`
-4. Remove everything judjged useless from the right panel.
-
-The following syntax specific settings have been removed:
+4. Do required changes to your needs.
+ a) To clean up, remove no longer needed overrides.
+ b) To restore, paste desired settings from following code block.
```json
{
- "color_scheme": "Packages/MarkdownEditing/MarkdownEditor.tmTheme",
-
+ "color_scheme": "MarkdownEditor.sublime-color-scheme",
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": false,
"auto_match_enabled": true,
-
// Layout
"draw_centered": true,
"word_wrap": true,
"wrap_width": 80,
"rulers": [],
-
// Line
"line_numbers": false,
"highlight_line": false,
"line_padding_top": 2,
"line_padding_bottom": 2,
-
// Caret
"caret_style": "wide",
"caret_extra_top": 3,
diff --git a/docs/usage.md b/docs/usage.md
index e517d46d..47916dfc 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -75,7 +75,7 @@ In that case you can manually enforce a style via `"mde.match_heading_hashes"` i
MarkdownEditing assists with maintaining width of underlined headings during typing.
-Just hit tab after `-` or `=` and underline width is adjusted to headings text length.
+Just hit Tab after `-` or `=` and underline width is adjusted to headings text length.
![headings-setext](img/headings-setext.png)
@@ -107,10 +107,10 @@ or use one of the following bindings:
| Linux/Windows | MacOS | Description
|---------------|-------|-------------
-| alt + k, alt + 0 | ^ + k, ^ + 0 | convert headings into normal text
-| alt + k, alt + 1..6 | ^ + k, ^ + 1..6 | set headings level to 1..6
-| ctrl + alt + , | ⌘ + ^ + , | reduce headings level by one
-| ctrl + alt + . | ⌘ + ^ + . | increase headings level by one
+| Alt + k, Alt + 0 | ^ + k, ^ + 0 | convert headings into normal text
+| Alt + k, Alt + 1..6 | ^ + k, ^ + 1..6 | set headings level to 1..6
+| Ctrl + Alt + , | ⌘ + ^ + , | reduce headings level by one
+| Ctrl + Alt + . | ⌘ + ^ + . | increase headings level by one
Key bindings can be disabled via `"mde.keymap_disable.set_heading_level": true`.
@@ -155,9 +155,9 @@ Folding is bound to following keys by default:
| Linux/Windows | MacOS | Description
|---------------|-------|-------------
-| ctrl + k, ctrl + 0 | ⌥ + k, ⌥ + 0 | Unfold all sections
-| ctrl + k, ctrl + 1..6 | ⌥ + k, ⌥ + 1..6 | Fold sections by level 1..6
-| ctrl + k, ctrl + 9 | ⌥ + k, ⌥ + 9 | Fold all sections, but keep headings of any level visible
+| Ctrl + k, Ctrl + 0 | ⌥ + k, ⌥ + 0 | Unfold all sections
+| Ctrl + k, Ctrl + 1..6 | ⌥ + k, ⌥ + 1..6 | Fold sections by level 1..6
+| Ctrl + k, Ctrl + 9 | ⌥ + k, ⌥ + 9 | Fold all sections, but keep headings of any level visible
| Shift + Tab | ⇧ + Tab | Fold/Unfold current section.
| Ctrl + Shift + Tab | ^ + ⇧ + Tab | Fold all sections under headings of a certain level.
@@ -205,6 +205,24 @@ Navigation is bound to following keys by default:
| Ctrl + Shift + PageUp/PageDown | ⌘ + ⇧ + PageUp/PageDown | Go to the previous/next heading of any level
| Ctrl + Alt + Shift + PageUp/PageDown | ⌘ + ⌥ + PageUp/PageDown | Go to the previous/next heading of the same or higher level
+# Block Quotes
+
+MarkdownEditing cretes a natural natural editing experience of block quotes.
+
+1. To convert selected text to a block quote just hit >.
+2. By hitting Enter a new empty block quote line is added.
+3. By hitting Del at the end of a block quote line,
+ the following line is merged by removing its leading quotes.
+4. Quoted text can be indented (Tab) and unindent (Shift + Tab) as it wasn't quoted.
+
+Further available key bindings:
+
+| Linux/Windows | MacOS | Description
+|---------------|-------|-------------
+| Ctrl + Shift + . | ⌘ + ⇧ + . | Increase block quote level (add one more `> `)
+| Ctrl + Shift + , | ⌘ + ⇧ + , | Decrease block quote level (remove a `> `)
+| Ctrl + Enter | ⌘ + Enterkbd> | Terminate block quote by adding two newline's.
If the current line is empty, block quote signs are removed.
+
# Lists and Tasks
List bullets are automatically changed when indenting or unindenting list items by default. This behaviour can be disabled via `"mde.list_indent_auto_switch_bullet": false`.
@@ -269,6 +287,8 @@ Important functions are bound to following keys by default:
| Ctrl + Alt + R | ⌘ + ⌥ + R | Creates or pastes the contents of the clipboard as a reference link.
| Shift + Win + K | ⌘ + ⇧ + K | Creates or pastes the contents of the clipboard as an inline image on selected text.
| Alt + Shift + 6 | ⌥ + ⇧ + 6 | Inserts a footnote.
+| F12 | F12 | Jump to reference/footnote definition.
+| Shift+F12 | Shift+F12 | Jump from definition to reference(s).
# Critic Markup
diff --git a/macros/Convert to Blockquote.sublime-macro b/macros/Add Line and Balance Trailing Hashes.sublime-macro
similarity index 71%
rename from macros/Convert to Blockquote.sublime-macro
rename to macros/Add Line and Balance Trailing Hashes.sublime-macro
index 9544bd77..ab26c765 100644
--- a/macros/Convert to Blockquote.sublime-macro
+++ b/macros/Add Line and Balance Trailing Hashes.sublime-macro
@@ -1,6 +1,5 @@
[
{"command": "expand_selection", "args": {"to": "line"}},
{"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
- {"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^/> /gm}"}},
- {"command": "move_to", "args": {"extend": false, "to": "eol"}}
+ {"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^(\\s*(?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/$1$2$3 $2\n$1/}"}}
]
diff --git a/macros/Add Line and Delete Trailing Hashes.sublime-macro b/macros/Add Line and Delete Trailing Hashes.sublime-macro
new file mode 100644
index 00000000..1c5d58bd
--- /dev/null
+++ b/macros/Add Line and Delete Trailing Hashes.sublime-macro
@@ -0,0 +1,5 @@
+[
+ {"command": "expand_selection", "args": {"to": "line"}},
+ {"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
+ {"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^(\\s*(?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/$1$2$3\n$1/}"}}
+]
diff --git a/macros/Balance Trailing Hashes.sublime-macro b/macros/Balance Trailing Hashes.sublime-macro
deleted file mode 100644
index a23bdd6c..00000000
--- a/macros/Balance Trailing Hashes.sublime-macro
+++ /dev/null
@@ -1,9 +0,0 @@
-[
- {"command": "move_to", "args": {"to": "eol", "extend": false}},
- {"command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/\n$1$2$3 $2\n$1/}"}},
- {"command": "move", "args": {"by": "lines", "forward": false}},
- {"command": "move", "args": {"by": "lines", "forward": false}},
- {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}},
- {"command": "move", "args": {"by": "lines", "forward": true}},
- {"command": "move_to", "args": {"to": "eol", "extend": false}}
-]
diff --git a/macros/Delete Empty Blockquote.sublime-macro b/macros/Delete Empty Blockquote.sublime-macro
new file mode 100644
index 00000000..5716827a
--- /dev/null
+++ b/macros/Delete Empty Blockquote.sublime-macro
@@ -0,0 +1,5 @@
+[
+ {"command": "expand_selection", "args": {"to": "line"}},
+ {"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
+ {"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^([\\s>]*)>.*/$1/}"}}
+]
diff --git a/macros/Delete Empty List Item.sublime-macro b/macros/Delete Empty List Item.sublime-macro
new file mode 100644
index 00000000..6fad501f
--- /dev/null
+++ b/macros/Delete Empty List Item.sublime-macro
@@ -0,0 +1,5 @@
+[
+ {"command": "expand_selection", "args": {"to": "line"}},
+ {"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
+ {"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^([\\s>]*).*/$1/}"}}
+]
diff --git a/macros/Delete Left 2.sublime-macro b/macros/Delete Left 2.sublime-macro
new file mode 100644
index 00000000..8174ef9b
--- /dev/null
+++ b/macros/Delete Left 2.sublime-macro
@@ -0,0 +1,4 @@
+[
+ {"command": "left_delete" },
+ {"command": "left_delete" }
+]
diff --git a/macros/Remove Empty Blockquote Line.sublime-macro b/macros/Remove Empty Blockquote Line.sublime-macro
deleted file mode 100644
index 9e727ffb..00000000
--- a/macros/Remove Empty Blockquote Line.sublime-macro
+++ /dev/null
@@ -1,5 +0,0 @@
-[
- {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}},
- {"command": "insert", "args": {"characters": "\n"}},
- {"command": "move", "args": {"by": "characters", "forward": false}}
-]
diff --git a/macros/Remove Empty List Item.sublime-macro b/macros/Remove Empty List Item.sublime-macro
deleted file mode 100644
index b387cd2d..00000000
--- a/macros/Remove Empty List Item.sublime-macro
+++ /dev/null
@@ -1,7 +0,0 @@
-[
- {"command": "move_to", "args": {"to": "eol", "extend": false}},
- {"command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*).*/\n$1/}"}},
- {"command": "move", "args": {"by": "lines", "forward": false}},
- {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}},
- {"command": "move_to", "args": {"to": "eol", "extend": false}}
-]
diff --git a/macros/Remove Trailing Hashes.sublime-macro b/macros/Remove Trailing Hashes.sublime-macro
deleted file mode 100644
index 73edc998..00000000
--- a/macros/Remove Trailing Hashes.sublime-macro
+++ /dev/null
@@ -1,9 +0,0 @@
-[
- {"command": "move_to", "args": {"to": "eol", "extend": false}},
- {"command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/\n$1$2$3\n$1/}"}},
- {"command": "move", "args": {"by": "lines", "forward": false}},
- {"command": "move", "args": {"by": "lines", "forward": false}},
- {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}},
- {"command": "move", "args": {"by": "lines", "forward": true}},
- {"command": "move_to", "args": {"to": "eol", "extend": false}}
-]
diff --git a/macros/Terminate Empty Blockquote.sublime-macro b/macros/Terminate Empty Blockquote.sublime-macro
new file mode 100644
index 00000000..ad1f5180
--- /dev/null
+++ b/macros/Terminate Empty Blockquote.sublime-macro
@@ -0,0 +1,5 @@
+[
+ {"command": "expand_selection", "args": {"to": "line"}},
+ {"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
+ {"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^(\\s*).*/\n$1/}"}}
+]
diff --git a/messages.json b/messages.json
index bc6c2755..6f46460c 100644
--- a/messages.json
+++ b/messages.json
@@ -30,5 +30,6 @@
"3.0.1": "messages/3.0.1.md",
"3.0.2": "messages/3.0.2.md",
"3.0.3": "messages/3.0.3.md",
- "3.0.4": "messages/3.0.4.md"
+ "3.0.4": "messages/3.0.4.md",
+ "3.0.5": "messages/3.0.5.md"
}
diff --git a/messages/3.0.5.md b/messages/3.0.5.md
new file mode 100644
index 00000000..f9fabbf2
--- /dev/null
+++ b/messages/3.0.5.md
@@ -0,0 +1,31 @@
+# MarkdownEditing 3.0.5 Changelog
+
+Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
+feedback you can use [GitHub issues][issues].
+
+## Bug Fixes
+
+* Restore incremental heading level keybinding on MacOS
+* Fenced codeblocks learned `go` and `dockerfile` language identifiers (fixes #650)
+* Hitting backspace removes only one block quote sign (fixes #651)
+* Add misssing keypad_enter bindings
+* Auto-complete setext heading underlines only if caret is at eol
+* Fix regression with tab after single `-` or `*` not inserting `\t`
+* shift+enter correctly indents 2nd line of GFM task
+* Maintain indentation of block quote content when adding new line
+
+## New Features
+
+* Add fenced code blocks protobuf highlighting (fixes #650)
+* Bind f12 and shift+f12 to jump between references and definitions
+* Block quotes can be terminated via ctrl+enter
+
+## Changes
+
+* The `>` key is bound to `mde_indent_quote` to replace `Convert to Blockquote` macro
+* The ctrl+alt+g is no longer bound by default in favor of f12
+* The `Balance Trailing Hashes` macro is renamed to `Add Newline and Balance Trailing Hashes`
+* The `Remove Trailing Hashes` macro is renamed to `Add Newline and Delete Trailing Hashes`
+* The `Remove Empty List Item` macro is renamed to `Delete Empty List Item`
+
+[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax
index 5be236dd..1b08225c 100644
--- a/syntaxes/Markdown.sublime-syntax
+++ b/syntaxes/Markdown.sublime-syntax
@@ -943,6 +943,7 @@ contexts:
- include: fenced-mermaid
- include: fenced-nim
- include: fenced-powershell
+ - include: fenced-protobuf
- include: fenced-reason
- include: fenced-sass
- include: fenced-scheme
@@ -1075,7 +1076,7 @@ contexts:
- match: |-
(?x)
{{fenced_code_block_start}}
- ((?i:golang))
+ ((?i:go(?:lang)?))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.go.markdown-gfm
@@ -1673,7 +1674,7 @@ contexts:
- match: |-
(?x)
{{fenced_code_block_start}}
- ((?i:docker))
+ ((?i:docker(?:file)?))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.docker.markdown-gfm
@@ -1875,6 +1876,23 @@ contexts:
0: meta.code-fence.definition.end.powershell.markdown-gfm
1: punctuation.definition.raw.code-fence.end.markdown
+ fenced-protobuf:
+ - match: |-
+ (?x)
+ {{fenced_code_block_start}}
+ ((?i:protobuf))
+ {{fenced_code_block_trailing_infostring_characters}}
+ captures:
+ 0: meta.code-fence.definition.begin.protobuf.markdown-gfm
+ 2: punctuation.definition.raw.code-fence.begin.markdown
+ 5: constant.other.language-name.markdown
+ embed: scope:source.proto
+ embed_scope: markup.raw.code-fence.protobuf.markdown-gfm
+ escape: '{{code_fence_escape}}'
+ escape_captures:
+ 0: meta.code-fence.definition.end.protobuf.markdown-gfm
+ 1: punctuation.definition.raw.code-fence.end.markdown
+
fenced-reason:
- match: |-
(?x)