Home Explore Blog CI



neovim

9th chunk of `runtime/doc/spell.txt`
7f982d84f6a03d0d5e53cbd2668eda61ff822c29e01bd7000000000100000fa2
 of Vim and contains a
section that is required for the spell file to work.  In this case it's
probably a good idea to upgrade your Vim.


SPELL FILE DUMP

If for some reason you want to check what words are supported by the currently
used spelling files, use this command:

							*:spelldump* *:spelld*
:spelld[ump]		Open a new window and fill it with all currently valid
			words.  Compound words are not included.
			Note: For some languages the result may be enormous,
			causing Vim to run out of memory.

:spelld[ump]!		Like ":spelldump" and include the word count.  This is
			the number of times the word was found while
			updating the screen.  Words that are in COMMON items
			get a starting count of 10.

The format of the word list is used |spell-wordlist-format|.  You should be
able to read it with ":mkspell" to generate one .spl file that includes all
the words.

When all entries to 'spelllang' use the same regions or no regions at all then
the region information is included in the dumped words.  Otherwise only words
for the current region are included and no "/regions" line is generated.

Comment lines with the name of the .spl file are used as a header above the
words that were generated from that .spl file.


SPELL FILE MISSING		*spell-SpellFileMissing* *spellfile.vim*

If the spell file for the language you are using is not available, you will
get an error message.  But if the "spellfile.vim" plugin is active it will
offer you to download the spell file.  Just follow the instructions, it will
ask you where to write the file (there must be a writable directory in
'runtimepath' for this).

The plugin has a default place where to look for spell files, on the Vim ftp
server.  The protocol used is SSL (https://) for security.  If you want to use
another location or another protocol, set the g:spellfile_URL variable to the
directory that holds the spell files.  You can use http:// or ftp://, but you
are taking a security risk then.  The |netrw| plugin is used for getting the
file, look there for the specific syntax of the URL.  Example: >
	let g:spellfile_URL = 'https://ftp.nluug.nl/vim/runtime/spell'
You may need to escape special characters.

The plugin will only ask about downloading a language once.  If you want to
try again anyway restart Vim, or set g:spellfile_URL to another value (e.g.,
prepend a space).

To avoid using the "spellfile.vim" plugin do this in your vimrc file: >

	let loaded_spellfile_plugin = 1

Instead of using the plugin you can define a |SpellFileMissing| autocommand to
handle the missing file yourself.  You can use it like this: >

	:au SpellFileMissing * call Download_spell_file(expand('<amatch>'))

Thus the <amatch> item contains the name of the language.  Another important
value is 'encoding', since every encoding has its own spell file.  With two
exceptions:
- For ISO-8859-15 (latin9) the name "latin1" is used (the encodings only
  differ in characters not used in dictionary words).
- The name "ascii" may also be used for some languages where the words use
  only ASCII letters for most of the words.

The default "spellfile.vim" plugin uses this autocommand, if you define your
autocommand afterwards you may want to use ":au! SpellFileMissing" to overrule
it.  If you define your autocommand before the plugin is loaded it will notice
this and not do anything.
							*E797*
Note that the SpellFileMissing autocommand must not change or destroy the
buffer the user was editing.

==============================================================================
4. Spell file format					*spell-file-format*

This is the format of the files that are used by the person who creates and
maintains a word list.

Note that we avoid the word "dictionary" here.  That is because the goal of
spell checking differs from writing a dictionary (as in the book).  For
spelling we need a list of words that are OK, thus should not be highlighted.
Person and company names will not appear in a dictionary, but do appear in a
word

Title: Spell File Dumping and Missing Spell File Handling
Summary
This section details how to dump the contents of spell files using the `:spelldump` command, including options to display word counts and region information. It also covers the `spellfile.vim` plugin and the `SpellFileMissing` autocommand. These handle scenarios where the required spell file is missing, offering to download it from a specified URL and providing options to customize the download location or disable the plugin's default behavior. The section also clarifies the spell file format, emphasizing the difference between a spell checker's word list and a dictionary.