skip to Main Content

I am using VS Code to write markdown files. Is there any way to use a wordlist with technical terms, which is stored in a separate folder outside the opened markdown project, for autocompletion?

At the moment the format of the wordlist with all technical terms is a text file which has on each line a particular term. However, it would be possible to reformat this file if necessary.

2

Answers


  1. If you have that wordlist open in your project, I would think that this setting should help:

    Editor: Word Based Suggestions Mode  // set to allDocuments
    

    That should suggest words from all open documents.

    Other wise you would probably have to make your extension with a CompletionProvider which incorporates your wordlist.

    Login or Signup to reply.
  2. You can use the extension Complete from File.

    You have to define the languageID and files to use with a configuration in settings.json:

      "complete-from-file.documents": {
        "markdown completions": {
          "documentSelectors": [{ "language": "markdown", "scheme": "file" }],
          "files": [
            "${workspaceFolder}${pathSeparator}markdown-complete.txt",
            "${userHome}${pathSeparator}completions${pathSeparator}markdown-complete.txt"
          ]
        }
      }
    

    Each line of the file is used as a possible completion item. The file can contain comments (// and # lines) and empty lines. A completion line can contain any character (including spaces) but the initial characters must be word characters.

    The default is that you need at least 3 characters to get a completion.
    This setting can be changed (complete-from-file.minimalCharacterCount).

    In Markdown files you have to request a completion with:
    Trigger Suggest (key: ctrl+space, commandID: editor.action.triggerSuggest)

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