A spell for running a re.sub on the current line.
pattern- regexp patternreplacement- replacement (i.e.repl) - when$clipboard, the clipboard content is used
{
"name": "Strip extra whitespace",
"context": {
"line_matches": ["\\S\\s\\s+"]
},
"spell": "perform_line_regex",
"args": {
"pattern": "(\\S)(\\s)\\s+",
"replacement": "\\1\\2"
}
}{
"name": "Add space to array",
"context": {
"line_matches": ["\\[.+\\]"]
},
"spell": "perform_line_regex",
"args": {
"pattern": "\\[(.+)\\]",
"replacement": "[ \\1 ]"
}
}