Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions Groovy/Default.sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[
// Auto-Pair double qutoed block strings
// - ""| -> """|"""
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\"\"\"" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.groovy - source.groovy string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^\"", "match_all": true }
]
},

// Convert double quoted block string to normal string
// - """|""" -> "|"
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" },
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.groovy punctuation.definition" },
{ "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": "^\"\"\"(?!\")", "match_all": true }
]
},

// Add empty line between double quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.groovy" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"\"$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"\"\"(?!\")", "match_all": true }
]
},

// Auto-Pair single qutoed block strings
// Example: key: ''|; -> key: '''|''';
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'''" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.groovy - source.groovy string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')''$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^'", "match_all": true }
]
},

// Convert single quoted block string to normal string
// - '''|''' -> '|'
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" }
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.groovy punctuation.definition" },
{ "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": "^'''(?!')", "match_all": true }
]
},

// Add empty line between single quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.groovy" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')'''$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^'''(?!')", "match_all": true }
]
}
]
86 changes: 86 additions & 0 deletions Java/Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,49 @@
]
},

// Auto-Pair double qutoed block strings
// Example: key: ""|; -> key: """|""";
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\"\"\"" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.java - source.java string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^\"", "match_all": true }
]
},

// Convert double quoted block string to normal string
// - """|""" -> "|"
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" },
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.java punctuation.definition" },
{ "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": "^\"\"\"(?!\")", "match_all": true }
]
},

// Add empty line between double quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.java" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"\"$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"\"\"(?!\")", "match_all": true }
]
},

// Auto-pair double quotes (also if followed by comma or semicolon)
// Example: key: |; -> key: '|';
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
Expand All @@ -24,4 +67,47 @@
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
]
},

// Auto-Pair single qutoed block strings
// Example: key: ''|; -> key: '''|''';
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'''" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.java - source.java string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')''$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^'", "match_all": true }
]
},

// Convert single quoted block string to normal string
// - '''|''' -> '|'
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" }
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.java punctuation.definition" },
{ "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": "^'''(?!')", "match_all": true }
]
},

// Add empty line between single quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.java" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')'''$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^'''(?!')", "match_all": true }
]
}
]
94 changes: 90 additions & 4 deletions Python/Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,50 @@
{ "key": "selection_empty", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
]
},

// Auto-Pair double qutoed block strings
// Example: key: ""|; -> key: """|""";
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\"\"\"" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.python - source.python comment - source.python string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^\"", "match_all": true }
]
},

// Convert double quoted block string to normal string
// - """|""" -> "|"
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" }
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.python punctuation.definition" },
{ "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": "^\"\"\"(?!\")", "match_all": true }
]
},

// Add empty line between double quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.python" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"\"$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"\"\"(?!\")", "match_all": true }
]
},

Expand Down Expand Up @@ -81,7 +124,50 @@
{ "key": "selection_empty", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true }
]
},

// Auto-Pair single qutoed block strings
// Example: key: ''|; -> key: '''|''';
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'''" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.python - source.python comment - source.python string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')''$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^'", "match_all": true }
]
},

// Convert single quoted block string to normal string
// - '''|''' -> '|'
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" }
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.python punctuation.definition" },
{ "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": "^'''(?!')", "match_all": true }
]
},

// Add empty line between single quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.python" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')'''$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^'''(?!')", "match_all": true }
]
},

Expand Down Expand Up @@ -149,15 +235,15 @@
{ "key": "selector", "operand": "source.python - source.python comment - source.python string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^\\s+(?:break|continue|pass|return\\b.*)$", "match_all": true }
],
]
},
{ "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/Python/Add Dedented Line.sublime-macro"}, "context":
[
{ "key": "setting.auto_indent", "operand": true },
{ "key": "selector", "operand": "source.python - source.python comment - source.python string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^\\s+(?:break|continue|pass|return\\b.*)$", "match_all": true }
],
]
},

// Prefer committing completions if "auto_complete_commit_on_tab" is disabled
Expand Down
86 changes: 86 additions & 0 deletions TOML/Default.sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[
// Auto-Pair double qutoed block strings
// Example: key: ""|; -> key: """|""";
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\"\"\"" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.toml - source.toml string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^\"", "match_all": true }
]
},

// Convert double quoted block string to normal string
// - """|""" -> "|"
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" },
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.toml punctuation.definition" },
{ "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": "^\"\"\"(?!\")", "match_all": true }
]
},

// Add empty line between double quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.toml" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!\")\"\"\"$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"\"\"(?!\")", "match_all": true }
]
},

// Auto-Pair single qutoed block strings
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'''" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.toml - source.toml string" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')''$", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^'", "match_all": true }
]
},

// Convert single quoted block string to normal string
// - '''|''' -> '|'
{ "keys": ["backspace"], "command": "chain", "args":
{
"commands": [
{"command": "left_delete" },
{"command": "right_delete" },
{"command": "left_delete" },
{"command": "right_delete" }
]
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selector", "operand": "source.toml punctuation.definition" },
{ "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": "^'''(?!')", "match_all": true }
]
},

// Add empty line between single quoted block string quotation marks
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n" }, "context":
[
{ "key": "setting.auto_match_enabled" },
{ "key": "selector", "operand": "source.toml" },
{ "key": "selection_empty", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?<!')'''$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^'''(?!')", "match_all": true }
]
}
]