skip to Main Content

How do I add it so when I type a word lets say "key" it changes it into lets say "key hole" (dumb example I know) in VS Code?

I have tried looking in the settings and haven’t got any farther then that.

3

Answers


  1. In the simple case of what you’ve shown above, you can just write a custom snippet. (see the Snippets: Configure User Snippets command in the command palette) Ex.

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

    I don’t think suggestions (outside of snippets) are configurable with vanilla (no extensions) VS Code aside from writing or using an extension that facilitates that.

    Login or Signup to reply.
  2. snippets can be used if you have complex text segments with fields.

    if you just want text replacement have a look at

    Complete from File

    Login or Signup to reply.
  3. My Code Actions

    It can also serve as an alternative to fixed text snippets. You can construct a number of include/import statements at the start of a new file for the actions that do not have a diagnostics property.

    Create your own snippets can also helpful.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search