Skip to main content
Module

x/denops_std/option/mod.ts>spellsuggest

📚 Standard module for denops.vim
Go to Latest
variable spellsuggest
import { spellsuggest } from "https://deno.land/x/denops_std@v6.3.0/option/mod.ts";

Methods used for spelling suggestions. Both for the z= command and the spellsuggest() function. This is a comma-separated list of items:

best Internal method that works best for English. Finds changes like "fast" and uses a bit of sound-a-like scoring to improve the ordering.

double Internal method that uses two methods and mixes the results. The first method is "fast", the other method computes how much the suggestion sounds like the bad word. That only works when the language specifies sound folding. Can be slow and doesn't always give better results.

fast Internal method that only checks for simple changes: character inserts/deletes/swaps. Works well for simple typing mistakes.

{number} The maximum number of suggestions listed for z=. Not used for spellsuggest(). The number of suggestions is never more than the value of 'lines' minus two.

timeout:{millisec} Limit the time searching for suggestions to {millisec} milli seconds. Applies to the following methods. When omitted the limit is 5000. When negative there is no limit. only works when built with the +reltime feature

file:{filename} Read file {filename}, which must have two columns, separated by a slash. The first column contains the bad word, the second column the suggested good word. Example: theribal/terrible Use this for common mistakes that do not appear at the top of the suggestion list with the internal methods. Lines without a slash are ignored, use this for comments. The word in the second column must be correct, otherwise it will not be used. Add the word to an ".add" file if it is currently flagged as a spelling mistake. The file is used for all languages.

expr:{expr} Evaluate expression {expr}. Use a function to avoid trouble with spaces. Best is to call a function without arguments, see expr-option-function. v:val holds the badly spelled word. The expression must evaluate to a List of Lists, each with a suggestion and a score. Example: [['the', 33], ['that', 44]] Set 'verbose' and use z= to see the scores that the internal methods use. A lower score is better. This may invoke spellsuggest() if you temporarily set 'spellsuggest' to exclude the "expr:" part. Errors are silently ignored, unless you set the 'verbose' option to a non-zero value.

Only one of "best", "double" or "fast" may be used. The others may appear several times in any order. Example:

:set sps=file:~/.vim/sugg,best,expr:MySuggest()

This option cannot be set from a modeline or in the sandbox, for security reasons.

(default "best")

not available when compiled without the +syntax feature