An hour ago, my snippets and keybindings were working in VSCode. I must have changed a setting on accident?
Problem: When I use custom keyboard shortcuts to call custom snippets, the snippet does not run. Instead, vscode provides a dropdown menu with all of my snippets (those with and without keybindings) and asks me to select one. But I shouldn't have to select one - the keybinding already 'knows' which snippet it should have ran.
How can I make my snippet run again with the keyboard shortcut?
{
"example snippet": {
"prefix": "ex",
"body": "const example = `${1:exampleText}`",
"description": "Example: exampleText"
}
}
When I type ex
+ tab
in my editor - it works.
Here is my keybinding
{
"key": "ctrl+e ctrl+x",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"arg": {
"name": "example snippet"
}
}
But when I press ctrl e x
, a dropdown appears asking to select my snippet.
How do I fix this behavior? It only asks me to select a snippet if the keyboard shortcut points to a snippet. For example, when I press Ctrl+C, this drop-down does not appear. It knows it is a snippet, but it thinks it doesn't know which snippet!