plugins.lsp.servers.ltex.settings

The settings for this LSP.

Type: attribute set of anything

Default: { }

Example:

{
  callback = {
    __raw = ''
      function()
        print('nixvim')
      end
    '';
  };
  foo_bar = 42;
  hostname = "localhost:8080";
}

Declared by:

plugins.lsp.servers.ltex.settings.enabled

Controls whether the extension is enabled. Allows disabling LanguageTool on specific workspaces or for specific code language modes (i.e., file types).

Either supply a boolean value stating whether LTEX is enabled for all supported markup languages or disabled for all of them, or supply a list of code language identifiers for which LTEX should be enabled (note that extensions can define additional code language identifiers).

All supported markup languages are listed in the default value of this setting. In addition, LTEX can check comments in many popular programming languages like C++ or Java, if you add the corresponding code language identifiers to this setting. If you add an unsupported code language mode, LTEX will check corresponding files as plain text without any parsing.

The activation events are unaffected by this setting. This means that the extension will be activated whenever a file with a supported code language mode is opened. For unsupported code language modes, you may need to activate the extension explicitly by executing the LTeX: Activate Extension command.

Examples:

  • true
  • false
  • [“latex” “markdown”]

Plugin default:

[
  "bibtex"
  "context"
  "context.tex"
  "html"
  "latex"
  "markdown"
  "org"
  "restructuredtext"
  "rsweave"
]

Type: null or boolean or list of (string or raw lua code) or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.enabledRules

Lists of rules that should be enabled (if disabled by default by LanguageTool). This setting is language-specific, so use an attrs of the format

  {
    "<LANGUAGE1>" = [
      "<WORD1>"
      "<WORD2>"
      ...
    ];
    "<LANGUAGE2>" = [
      "<WORD1>"
      "<WORD2>"
    ];
    ...
  };

where <LANGUAGE> denotes the language code in settings.language and <RULE> the ID of the LanguageTool rule.

This setting is a multi-scope setting. See the documentation for details. This setting supports external files. See the documentation for details. By default, no additional rules will be enabled.

Example:

  {
    "en-GB" = [
      "PASSIVE_VOICE"
      "OXFORD_SPELLING_NOUNS"
      ":/path/to/externalFile.txt"
    ];
  }

Plugin default: { }

Type: null or (attribute set of ((list of (string or raw lua code)) or raw lua code))

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.checkFrequency

Controls when documents should be checked.

Possible values:

  • “edit”: Documents are checked when they are opened or edited (on every keystroke), or when the settings change.
  • “save”: Documents are checked when they are opened or saved, or when the settings change.
  • “manual”: Documents are not checked automatically, except when the settings change. Use commands such as LTeX: Check Current Document to manually trigger checks.

Plugin default: "edit"

Type: null or one of “edit”, “save”, “manual” or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.clearDiagnosticsWhenClosingFile

If set to true, diagnostics of a file are cleared when the file is closed.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.completionEnabled

Controls whether completion is enabled (also known as auto-completion, quick suggestions, and IntelliSense).

If this setting is enabled, then a list of words is displayed that complete the currently typed word (whenever the editor sends a completion request).

In VS Code, completion is enabled by default while typing (via editor.quickSuggestions). Therefore, this setting is disabled by default, as constantly displaying completion lists might annoy the user. It is recommended to enable this setting.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.configurationTarget

Controls which settings.json or external setting file (see documentation) to update when using one of the quick fixes.

Plugin default:

{
  dictionary = "workspaceFolderExternalFile";
  disabledRules = "workspaceFolderExternalFile";
  hiddenFalsePositives = "workspaceFolderExternalFile";
}

Type: null or (attribute set of (string or raw lua code))

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.diagnosticSeverity

Severity of the diagnostics corresponding to the grammar and spelling errors.

Controls how and where the diagnostics appear. The possible severities are “error”, “warning”, “information”, and “hint”.

This setting can either be a string with the severity to use for all diagnostics, or an attrs with rule-dependent severities. If an attrs is used, each key is the ID of a LanguageTool rule and each value is one of the possible severities. In this case, the severity of other rules, which don’t match any of the keys, has to be specified with the special key “default”.

Examples:

  • "information"
  • {PASSIVE_VOICE = "hint"; default = "information";}

Plugin default: information

Type: null or string or attribute set of (string or raw lua code) or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.dictionary

Lists of additional words that should not be counted as spelling errors. This setting is language-specific, so use an attrs of the format

  {
    "<LANGUAGE1>" = [
      "<WORD1>"
      "<WORD2>"
      ...
    ];
    "<LANGUAGE2>" = [
      "<WORD1>"
      "<WORD2>"
    ];
    ...
  };

where <LANGUAGE> denotes the language code in settings.language.

This setting is a multi-scope setting. See the documentation for details. This setting supports external files. See the documentation for details. By default, no additional spelling errors will be ignored.

Example:

{
  "en-US" = [
    "adaptivity"
    "precomputed"
    "subproblem"
  ];
  "de-DE" = [
    "B-Splines"
    ":/path/to/externalFile.txt"
  ];
}

Plugin default: { }

Type: null or (attribute set of ((list of (string or raw lua code)) or raw lua code))

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.disabledRules

Lists of rules that should be disabled (if enabled by default by LanguageTool). This setting is language-specific, so use an attrs of the format

  {
    "<LANGUAGE1>" = [
      "<WORD1>"
      "<WORD2>"
      ...
    ];
    "<LANGUAGE2>" = [
      "<WORD1>"
      "<WORD2>"
    ];
    ...
  };

where <LANGUAGE> denotes the language code in settings.language and <RULE> the ID of the LanguageTool rule.

This setting is a multi-scope setting. See the documentation for details. This setting supports external files. See the documentation for details. By default, no additional rules will be disabled.

Example:

{
  "en-US" = [
    "EN_QUOTES"
    "UPPERCASE_SENTENCE_START"
    ":/path/to/externalFile.txt"
  ];
}

Plugin default: { }

Type: null or (attribute set of ((list of (string or raw lua code)) or raw lua code))

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.fields

List of BibTEX fields whose values are to be checked in BibTEX files.

This setting is an attrs with the field names as keys (not restricted to classical BibTEX fields) and booleans as values, where true means that the field value should be checked and false means that the field value should be ignored.

Some common fields are already ignored, even if you set this setting to an empty attrs.

Example:

  {
    maintitle = false;
    seealso = true;
  }

Plugin default: { }

Type: null or (attribute set of (boolean or raw lua code))

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.hiddenFalsePositives

Lists of false-positive diagnostics to hide (by hiding all diagnostics of a specific rule within a specific sentence). This setting is language-specific, so use an attrs of the format

  {
    "<LANGUAGE1>" = [
      "<JSON1>"
      "<JSON2>"
      ...
    ];
    "<LANGUAGE2>" = [
      "<JSON1>"
      "<JSON2>"
    ];
    ...
  };

where <LANGUAGE> denotes the language code in settings.language and <JSON> is a JSON string containing information about the rule and sentence.

Although it is possible to manually edit this setting, the intended way is the Hide false positive quick fix.

The JSON string currently has the form {"rule": "<RULE>", "sentence": "<SENTENCE>"}, where <RULE> is the ID of the LanguageTool rule and <SENTENCE> is a Java-compatible regular expression. All occurrences of the given rule are hidden in sentences (as determined by the LanguageTool tokenizer) that match the regular expression. See the documentation for details.

This setting is a multi-scope setting. See the documentation for details. This setting supports external files. See the documentation for details. If this list is very large, performance may suffer.

Example:

  {
    "en-US" = [ ":/path/to/externalFile.txt" ];
  }

Plugin default: { }

Type: null or (attribute set of ((list of (string or raw lua code)) or raw lua code))

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.language

The language (e.g., “en-US”) LanguageTool should check against. Use a specific variant like “en-US” or “de-DE” instead of the generic language code like “en” or “de” to obtain spelling corrections (in addition to grammar corrections).

When using the language code “auto”, LTEX will try to detect the language of the document. This is not recommended, as only generic languages like “en” or “de” will be detected and thus no spelling errors will be reported.

Possible values:

  • “auto”: Automatic language detection (not recommended)
  • “ar”: Arabic
  • “ast-ES”: Asturian
  • “be-BY”: Belarusian
  • “br-FR”: Breton
  • “ca-ES”: Catalan
  • “ca-ES-valencia”: Catalan (Valencian)
  • “da-DK”: Danish
  • “de”: German
  • “de-AT”: German (Austria)
  • “de-CH”: German (Swiss)
  • “de-DE”: German (Germany)
  • “de-DE-x-simple-language”: Simple German
  • “el-GR”: Greek
  • “en”: English
  • “en-AU”: English (Australian)
  • “en-CA”: English (Canadian)
  • “en-GB”: English (GB)
  • “en-NZ”: English (New Zealand)
  • “en-US”: English (US)
  • “en-ZA”: English (South African)
  • “eo”: Esperanto
  • “es”: Spanish
  • “es-AR”: Spanish (voseo)
  • “fa”: Persian
  • “fr”: French
  • “ga-IE”: Irish
  • “gl-ES”: Galician
  • “it”: Italian
  • “ja-JP”: Japanese
  • “km-KH”: Khmer
  • “nl”: Dutch
  • “nl-BE”: Dutch (Belgium)
  • “pl-PL”: Polish
  • “pt”: Portuguese
  • “pt-AO”: Portuguese (Angola preAO)
  • “pt-BR”: Portuguese (Brazil)
  • “pt-MZ”: Portuguese (Moçambique preAO)
  • “pt-PT”: Portuguese (Portugal)
  • “ro-RO”: Romanian
  • “ru-RU”: Russian
  • “sk-SK”: Slovak
  • “sl-SI”: Slovenian
  • “sv”: Swedish
  • “ta-IN”: Tamil
  • “tl-PH”: Tagalog
  • “uk-UA”: Ukrainian
  • “zh-CN”: Chinese

Plugin default: "en-US"

Type: null or string or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.languageToolHttpServerUri

If set to a non-empty string, LTEX will not use the bundled, built-in version of LanguageTool. Instead, LTEX will connect to an external LanguageTool HTTP server. Set this setting to the root URI of the server, and do not append v2/check or similar.

Note that in this mode, the settings settings.additionalRules.languageModel, settings.additionalRules.neuralNetworkModel, and settings.additionalRules.word2VecModel will not take any effect.

Example: "http://localhost:8081/"

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.sentenceCacheSize

Size of the LanguageTool ResultCache in sentences (must be a positive integer).

If only a small portion of the text changed (e.g., a single key press in the editor), LanguageTool uses the cache to avoid rechecking the complete text. LanguageTool internally splits the text into sentences, and sentences that have already been checked are skipped.

Decreasing this might decrease RAM usage of the Java process. If you set this too small, checking time may increase significantly.

Changes require restarting LTEX to take effect.

Plugin default: 2000

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.lsp.servers.ltex.settings.statusBarItem

If set to true, an item about the status of LTEX is shown permanently in the status bar.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by: