I'm trying to move from sublime to vscode, and can't get how to move some of my keybindigs. One of them is "=" which inserts <?=$1?>
when I'm editing html code in php files. What is more in sublime I've configure it to match some preceding text so it doesn't insert for "=" after attributes <img src=""/>
will be tipped as it is.
In sublime it was configured as
{ "keys": ["="], "command": "run_macro_file", "args": {"file": "res://Packages/User/macro/php/quick_echo_php.sublime-macro"}, "context":[
{"key": "selector", "operator": "equal", "operand": "embedding.php", "match_all":true},
{"key": "selector", "operator": "not_equal", "operand": "meta.embedded.line.php", "match_all":true},
{"key": "selector", "operator": "not_equal", "operand": "source.php", "match_all":true},
{"key": "selector", "operator": "not_equal", "operand": "source.js.embedded.html", "match_all":true},
{"key": "selector", "operator": "not_equal", "operand": "punctuation.definition.tag.end.html", "match_all":true},
{"key": "preceding_text", "operator": "not_regex_match", "operand": ".*<"},
{"key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\?"},
{"key": "preceding_text", "operator": "not_regex_match", "operand": ".*[a-zA-Zа-яА-Я]+"},
{"key": "setting.command_mode", "operand": false}
]},
In vscode all I end with is
{
"key": "=",
"command": "editor.action.insertSnippet",
"args": {"snippet": "<?=$1?>"},
"when": "vim.active && !inDebugRepl && vim.mode == Insert && editorLangId =~ /php|html/"
},
and obvious it is useless cause "=" is really necessary symbol in all php for example $a = 1;
I didn't find anything useful in "Developer: Inspect Context Keys". I even tried to ctrl+f "html" in vscode dev console after focused html line in php file and saw zero matches there. I just can't find scope for keybindigs but it exists for snippets.
P.S "langId"
in "args"
doesn't help ether.