Sublime Forum

Auto-Pair Quotes

#21

Hmm, I think I’ve made a start with this:

[code]{ “keys”: “tab”], “command”: “move”, “args”: {“by”: “characters”, “forward”: true}, “context”:

	{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
	{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true },
	{ "key": "selection_empty", "operator": "equal", "operand": false },
	{ "key": "following_text", "operator": "regex_contains", "operand": "\\*_\\]\\)\\}\"']", "match_all": true }
]

},[/code]

That requires me to hit tab twice to move past the closing token (once to deselect, then again to move). Is it possible to move by 2 characters?

EDIT: Actually, the regex doesn’t make any difference - the command is triggered no matter what. Hrm.

0 Likes

#22

I suppose you can create a macro and run it in place of the move command:

"command": "run_macro_file", "args": {"file": "Packages/User/Move two chars forward.sublime-macro"}
0 Likes

#23

Yeah, thanks, that would work. I’ve kind of got used to it how it is and quite like it now. /me is fickle. :smile:

0 Likes