Home Explore Blog CI



neovim

12th chunk of `runtime/doc/spell.txt`
30dd98088da3ab99c02b9a0433fffb2010a3b15ea524acaf0000000100000fab
 at this position.  The same word with a lower-case letter at this
position will not match. When some of the other letters are upper-case it will
not match either.

The word with all upper-case characters will always be OK,

	word list	matches			does not match ~
	als		als Als ALS		ALs AlS aLs aLS
	Als		Als  ALS		als ALs AlS aLs aLS
	ALS		ALS			als Als ALs AlS aLs aLS
	AlS		AlS ALS			als Als ALs aLs aLS

The KEEPCASE affix ID can be used to specifically match a word with identical
case only, see below |spell-KEEPCASE|.

Note: in line 5 to 7 non-word characters are used.  You can include any
character in a word.  When checking the text a word still only matches when it
appears with a non-word character before and after it.  For Myspell a word
starting with a non-word character probably won't work.

In line 12 the word "TCP/IP" is defined.  Since the slash has a special
meaning the comma is used instead.  This is defined with the SLASH item in the
affix file, see |spell-SLASH|.  Note that without this SLASH item the word
will be "TCP,IP".


AFFIX FILE FORMAT			*spell-aff-format* *spell-affix-vim*

							*spell-affix-comment*
Comment lines in the .aff file start with a '#':

	# comment line ~

Items with a fixed number of arguments can be followed by a comment.  But only
if none of the arguments can contain white space.  The comment must start with
a "#" character.  Example:

	KEEPCASE =  # fix case for words with this flag ~


ENCODING							*spell-SET*

The affix file can be in any encoding that is supported by "iconv".  However,
in some cases the current locale should also be set properly at the time
|:mkspell| is invoked.  Adding FOL/LOW/UPP lines removes this requirement
|spell-FOL|.

The encoding should be specified before anything where the encoding matters.
The encoding applies both to the affix file and the dictionary file.  It is
done with a SET line:

	SET utf-8 ~

The encoding can be different from the value of the 'encoding' option at the
time ":mkspell" is used.  Vim will then convert everything to 'encoding' and
generate a spell file for 'encoding'.  If some of the used characters to not
fit in 'encoding' you will get an error message.
							*spell-affix-mbyte*
When using a multibyte encoding it's possible to use more different affix
flags.  But Myspell doesn't support that, thus you may not want to use it
anyway.  For compatibility use an 8-bit encoding.


INFORMATION

These entries in the affix file can be used to add information to the spell
file.  There are no restrictions on the format, but they should be in the
right encoding.

				*spell-NAME* *spell-VERSION* *spell-HOME*
				*spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT*
	NAME		Name of the language
	VERSION		1.0.1  with fixes
	HOME		https://www.example.com
	AUTHOR		John Doe
	EMAIL		john AT Doe DOT net
	COPYRIGHT	LGPL

These fields are put in the .spl file as-is.  The |:spellinfo| command can be
used to view the info.

							*:spellinfo* *:spelli*
:spelli[nfo]		Display the information for the spell file(s) used for
			the current buffer.


CHARACTER TABLES
							*spell-affix-chars*
When using an 8-bit encoding the affix file should define what characters are
word characters.  This is because the system where ":mkspell" is used may not
support a locale with this encoding and isalpha() won't work.  For example
when using "cp1250" on Unix.
						*E761* *E762* *spell-FOL*
						*spell-LOW* *spell-UPP*
Three lines in the affix file are needed.  Simplistic example:

	FOL  áëñ ~
	LOW  áëñ ~
	UPP  ÁËÑ ~

All three lines must have exactly the same number of characters.

The "FOL" line specifies the case-folded characters.  These are used to
compare words while ignoring case.  For most encodings this is identical to
the lower case line.

The "LOW" line specifies the characters in lower-case.  Mostly it's equal to
the "FOL" line.

The "UPP" line specifies the characters with upper-case.  That is, a character
is upper-case where it's different from the character at the

Title: Affix File Format, Encoding, and Character Tables
Summary
This section continues detailing the affix file format, including comment lines, encoding specification, and information entries. It explains how to define the character encoding using the `SET` line and its impact on file handling during the `:mkspell` command. The section also describes information entries like `NAME`, `VERSION`, `HOME`, `AUTHOR`, `EMAIL`, and `COPYRIGHT` that can be added to the spell file and viewed with the `:spellinfo` command. Furthermore, it explains how to use character tables (`FOL`, `LOW`, and `UPP`) to define word characters when using an 8-bit encoding.