A spell swaping values on the current line. Given an array of values, it cycles through them.
Does not require (but supports) explicit context
. An additional context
of "line_matches
one of the values
" is added.
values
- values to cycle through (values are escaped usingre.escape
so don't worry about special characters)
{
"name": "Toggle true/false",
"spell": "toggle_values",
"args": {
"values": ["true", "false"]
}
}
{
"name": "Toggle CSS direction",
"context": {
"scope": ["source\\.(css|less|sass|scss)"]
},
"spell": "toggle_values",
"args": {
"values": ["-top", "-bottom", "-left", "-right"]
}
}