Thanks for the pointer on where to go. I’ve added this to my user key-bindings. Everything seems to work the way I’d expect now.
// if selected text is \" and user type \" user only get one \"
{ "keys": "\""], "command": "insert_snippet", "args": {"contents": "\""}, "context":
{ "key": "text", "operator": "regex_contains", "operand": "\"", "match_all": true }
]
},
// if selected text is \" and user type ' user only get one '
{ "keys": "'"], "command": "insert_snippet", "args": {"contents": "'"}, "context":
{ "key": "text", "operator": "regex_contains", "operand": "\"", "match_all": true }
]
},
// if selected text is ' and user type \" user only get one \"
{ "keys": "\""], "command": "insert_snippet", "args": {"contents": "\""}, "context":
{ "key": "text", "operator": "regex_contains", "operand": "'", "match_all": true }
]
},
// if selected text is ' and user type ' user only get one '
{ "keys": "'"], "command": "insert_snippet", "args": {"contents": "'"}, "context":
{ "key": "text", "operator": "regex_contains", "operand": "'", "match_all": true }
]
}
Everyday I use ST I am getting more happy that I purchased it and now I want to add more customizing to it
question: I’ve looked at all the key binding options and can’t seem to find anything like I’m needing, but is there context operand that will find the first regex match after the caret? but not necessarily in a selection? I’d like to be able to select (or put the caret beside) a " or a ’ and if I type \ it will turn it into a " or a ’ (depending on the the character next to the caret is) then find the next instance " or ’ and change that to a " or a ’
If thats even possible?