3

I have gotten user snippets in VSCode to work for C and C++, but for some reason VSCode is not providing snippet suggestions for .md and .tex files.

Here is a minimal example of tex.json (that doesn't work):

{
    "dummy": {
        "prefix": "dummy",
        "body": [
            "some random text for demonstration"
        ],
        "description": "A dummy snippet"
    }
}

VSCode provides suggestions in .md and .tex files, just not user snippets. How do I fix this issue or employ some other way to use user snippets for Markdown and Latex?

Update: Snippets are now working in .md files, thanks to the comment by @Mark. I need to type the prefix and press Ctrl + Space. This solution does not, however, work for Latex.

  • 2
    It looks like you need to `Ctrl+space` for markdown at least, see https://github.com/microsoft/vscode/issues/1617 You do not get automatic suggestions. – Mark Aug 25 '21 at 18:45

2 Answers2

5

For markdown files try this language-specific setting in your settings.json file:

  "[markdown]": {
    "editor.quickSuggestions": {
      "other": true,
      "comments": true,
      "strings": true
    }
  }

and you shouldn't need to trigger the snippet suggestion with Ctrl+Space anymore.

[For latex files I don't need that setting - if snippets aren't working in your latex files try the same setting but with latex.]

Mark
  • 143,421
  • 24
  • 428
  • 436
0

Sometimes "Ctrl+ Space" is a shortcut for switching input methods on Windows, please turn it off, it works for me

  • How to turn it off? – Aditya Harikrish Mar 23 '22 at 14:42
  • @AdityaHarikrish Start -> Settings -> Devices -> Typing _(on left panel)_ -> Advanced keyboard settings _(link at the bottom of right section)_ -> Input language hot keys _(link)_. Then change (or remove) key sequence in Windows classic window, if you have `CTRL + SPACE` for any from the list – hotenov Mar 29 '23 at 15:04