-
-
Save poritsky/4265063 to your computer and use it in GitHub Desktop.
Key commands to quickly create Markdown headers in Brett Terpstra's MarkdownEditing plugin for Sublime Text 2. ⌘^1 for #, ⌘^2 for ## and so on. Works on selected text too. Just add the following anywhere in your Default (OSX).sublime-keymap file for MarkdownEditing (or any relevant package for ST2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "keys": ["super+ctrl+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+ctrl+1"], "command": "insert_snippet", "args": {"contents": "#${0: ${SELECTION/(^ | $)//g} }#\n\n$1"}, "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 } | |
] | |
}, | |
{ "keys": ["super+ctrl+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+ctrl+2"], "command": "insert_snippet", "args": {"contents": "##${0: ${SELECTION/(^ | $)//g} }##\n\n$1"}, "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 } | |
] | |
}, | |
{ "keys": ["super+ctrl+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+ctrl+3"], "command": "insert_snippet", "args": {"contents": "###${0: ${SELECTION/(^ | $)//g} }###\n\n$1"}, "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 } | |
] | |
}, | |
{ "keys": ["super+ctrl+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+ctrl+4"], "command": "insert_snippet", "args": {"contents": "####${0: ${SELECTION/(^ | $)//g} }####\n\n$1"}, "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 } | |
] | |
}, | |
{ "keys": ["super+ctrl+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+ctrl+5"], "command": "insert_snippet", "args": {"contents": "#####${0: ${SELECTION/(^ | $)//g} }#####\n\n$1"}, "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 } | |
] | |
}, | |
{ "keys": ["super+ctrl+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+ctrl+6"], "command": "insert_snippet", "args": {"contents": "######${0: ${SELECTION/(^ | $)//g} }######\n\n$1"}, "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 } | |
] | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pull request or it didn't happen.