[ // Bold on CMD + Shit + B { "keys": ["super+shift+b"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Transform Word - Bold.sublime-macro"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+shift+b"], "command": "insert_snippet", "args": {"contents": "${MD_BOLD_MARKER}$1${MD_BOLD_MARKER}"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+shift+b"], "command": "insert_snippet", "args": {"contents": "${MD_BOLD_MARKER}${SELECTION/(^[\\*_]*|[\\*_]*$)//g}${MD_BOLD_MARKER}"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, // Italics on CMD + Shift + I { "keys": ["super+shift+i"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Transform Word - Italic.sublime-macro"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+shift+i"], "command": "insert_snippet", "args": {"contents": "${MD_ITALIC_MARKER}$0${MD_ITALIC_MARKER}"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+shift+i"], "command": "insert_snippet", "args": {"contents": "${MD_ITALIC_MARKER}${SELECTION/(^[\\*_]*|[\\*_]*$)//g}${MD_ITALIC_MARKER}"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, // Unbold on CMD + Shift + B if already bold { "keys": ["super+shift+b"], "command": "insert_snippet", "args": {"contents": "${SELECTION/(^[\\*_]{2}|[\\*_]{2}$)//g}"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "text", "operator": "regex_match", "operand": "^[*_]{2}.*[*_]{2}$", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+shift+b"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Transform Word - Unbold Unitalicize.sublime-macro"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.bold.markdown", "match_all": true } ] }, { "keys": ["super+shift+b"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Transform Word - Unbold Unitalicize.sublime-macro"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "\\b__+\\S+__+$", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, // Unitalicize on CMD + Shift + I if already italic { "keys": ["super+shift+i"], "command": "insert_snippet", "args": {"contents": "${SELECTION/(^[\\*_]|[\\*_]$)//g}"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "text", "operator": "regex_match", "operand": "^[*_].*[*_]$", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+shift+i"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Transform Word - Unbold Unitalicize.sublime-macro"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.italic.markdown", "match_all": true } ] }, { "keys": ["super+shift+i"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Transform Word - Unbold Unitalicize.sublime-macro"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "\\b_(?!_)\\S+_$", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, // Inline link insertion : CMD + Shift + K { "keys": ["super+shift+k"], "command": "insert_snippet", "args": {"contents": "[$1]($0)"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+shift+k"], "command": "insert_snippet", "args": {"contents": "[$SELECTION]($0)"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, // Set Headers Levels With Shortcuts : CMD + # (1-6) { "keys": ["super+1"], "command": "insert_snippet", "args": {"contents": "# $0"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+1"], "command": "insert_snippet", "args": {"contents": "#${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g}}$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": false }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+1"], "command": "insert_snippet", "args": {"contents": "#${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g} }#$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+2"], "command": "insert_snippet", "args": {"contents": "## $0"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+2"], "command": "insert_snippet", "args": {"contents": "##${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g}}$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": false }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+2"], "command": "insert_snippet", "args": {"contents": "##${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g} }##$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+3"], "command": "insert_snippet", "args": {"contents": "### $0"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+3"], "command": "insert_snippet", "args": {"contents": "###${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g}}$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": false }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+3"], "command": "insert_snippet", "args": {"contents": "###${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g} }###$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+4"], "command": "insert_snippet", "args": {"contents": "#### $0"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+4"], "command": "insert_snippet", "args": {"contents": "####${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g}}$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": false }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+4"], "command": "insert_snippet", "args": {"contents": "####${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g} }####$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+5"], "command": "insert_snippet", "args": {"contents": "##### $0"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+5"], "command": "insert_snippet", "args": {"contents": "#####${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g}}$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": false }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+5"], "command": "insert_snippet", "args": {"contents": "#####${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g} }#####$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+6"], "command": "insert_snippet", "args": {"contents": "###### $0"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }, { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true }, { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+6"], "command": "insert_snippet", "args": {"contents": "######${0: ${SELECTION/(^( +)?(#+)?\\s*|\\s*(#+)?( +)?$)//g}}$1"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "setting.mde.match_header_hashes", "operator": "equal", "operand": false }, { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, // insert footnote : CMD + Shift + 6 { "keys": ["super+shift+6"], "command": "insert_footnote", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, // indent / deindentquote : CMD + . { "keys": ["super+."], "command": "indent_quote", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["super+."], "command": "deindent_quote", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "(> )+", "match_all": true } ] }]