How to add custom suggestions in VS Code?
P粉207483087
P粉207483087 2023-09-07 11:56:28
0
2
435

How do I add this so that when I type a word "key" into VS Code it changes it to "keyhole" (dumb example I know)?

I tried looking at the settings but got no further.

P粉207483087
P粉207483087

reply all(2)
P粉752479467

If you have complex text segments with fields, you can use fragments.

If you just want to replace text, check out

Complete from file

P粉920485285

In the simple case shown above, you can write a custom code snippet. (See Snippets in Command Palette: Configuring User Snippets Commands) For example.

{
    "key": {
        "prefix": "key",
        "body": "key hole",
        // "scope": "java" // uncomment to make it only apply for Java files
    }
}

I think that aside from writing or using an extension that helps achieve this, the suggestion (outside of snippets) could be to use plain (no extension) VS Code for configuration.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template