blob: b6f0c1ff576fca79c9a5718d90cd0c520ab6a258 [file] [log] [blame]
Bram Moolenaarc81e5e72007-05-05 18:24:42 +00001*spell.txt* For Vim version 7.1a. Last change: 2007 Apr 22
Bram Moolenaar217ad922005-03-20 22:37:15 +00002
3
4 VIM REFERENCE MANUAL by Bram Moolenaar
5
6
7Spell checking *spell*
8
91. Quick start |spell-quickstart|
Bram Moolenaard042c562005-06-30 22:04:15 +0000102. Remarks on spell checking |spell-remarks|
113. Generating a spell file |spell-mkspell|
124. Spell file format |spell-file-format|
Bram Moolenaar217ad922005-03-20 22:37:15 +000013
14{Vi does not have any of these commands}
15
16Spell checking is not available when the |+syntax| feature has been disabled
17at compile time.
18
Bram Moolenaarc81e5e72007-05-05 18:24:42 +000019Note: There also is a vimspell plugin. If you have it you can do ":help
20vimspell" to find about it. But you will probably want to get rid of the
21plugin and use the 'spell' option instead, it works better.
22
Bram Moolenaar217ad922005-03-20 22:37:15 +000023==============================================================================
241. Quick start *spell-quickstart*
25
26This command switches on spell checking: >
27
28 :setlocal spell spelllang=en_us
29
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +000030This switches on the 'spell' option and specifies to check for US English.
Bram Moolenaar217ad922005-03-20 22:37:15 +000031
32The words that are not recognized are highlighted with one of these:
Bram Moolenaar520470a2005-06-16 21:59:56 +000033 SpellBad word not recognized |hl-SpellBad|
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000034 SpellCap word not capitalised |hl-SpellCap|
Bram Moolenaar520470a2005-06-16 21:59:56 +000035 SpellRare rare word |hl-SpellRare|
36 SpellLocal wrong spelling for selected region |hl-SpellLocal|
Bram Moolenaar217ad922005-03-20 22:37:15 +000037
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +000038Vim only checks words for spelling, there is no grammar check.
39
Bram Moolenaar45360022005-07-21 21:08:21 +000040If the 'mousemodel' option is set to "popup" and the cursor is on a badly
41spelled word or it is "popup_setpos" and the mouse pointer is on a badly
Bram Moolenaar16d8f872005-11-26 23:46:11 +000042spelled word, then the popup menu will contain a submenu to replace the bad
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000043word. Note: this slows down the appearance of the popup menu. Note for GTK:
44don't release the right mouse button until the menu appears, otherwise it
45won't work.
Bram Moolenaar45360022005-07-21 21:08:21 +000046
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +000047To search for the next misspelled word:
48
49 *]s* *E756*
50]s Move to next misspelled word after the cursor.
Bram Moolenaar9d0ec2e2005-04-20 19:45:58 +000051 A count before the command can be used to repeat.
Bram Moolenaarac6e65f2005-08-29 22:25:38 +000052 'wrapscan' applies.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +000053
54 *[s*
Bram Moolenaar9d0ec2e2005-04-20 19:45:58 +000055[s Like "]s" but search backwards, find the misspelled
Bram Moolenaar30abd282005-06-22 22:35:10 +000056 word before the cursor. Doesn't recognize words
57 split over two lines, thus may stop at words that are
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +000058 not highlighted as bad. Does not stop at word with
59 missing capital at the start of a line.
Bram Moolenaar9d0ec2e2005-04-20 19:45:58 +000060
61 *]S*
62]S Like "]s" but only stop at bad words, not at rare
63 words or words for another region.
64
65 *[S*
66[S Like "]S" but search backwards.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +000067
Bram Moolenaar217ad922005-03-20 22:37:15 +000068
Bram Moolenaarf75a9632005-09-13 21:20:47 +000069To add words to your own word list:
Bram Moolenaar82cf9b62005-06-07 21:09:25 +000070
71 *zg*
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +000072zg Add word under the cursor as a good word to the first
Bram Moolenaarda2303d2005-08-30 21:55:26 +000073 name in 'spellfile'. A count may precede the command
74 to indicate the entry in 'spellfile' to be used. A
75 count of two uses the second entry.
76
77 In Visual mode the selected characters are added as a
78 word (including white space!).
79 When the cursor is on text that is marked as badly
80 spelled then the marked text is used.
81 Otherwise the word under the cursor, separated by
82 non-word characters, is used.
83
84 If the word is explicitly marked as bad word in
85 another spell file the result is unpredictable.
Bram Moolenaar82cf9b62005-06-07 21:09:25 +000086
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +000087 *zG*
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +000088zG Like "zg" but add the word to the internal word list
89 |internal-wordlist|.
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +000090
Bram Moolenaar82cf9b62005-06-07 21:09:25 +000091 *zw*
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +000092zw Like "zg" but mark the word as a wrong (bad) word.
Bram Moolenaar87b5ca52006-03-04 21:55:31 +000093 If the word already appears in 'spellfile' it is
94 turned into a comment line. See |spellfile-cleanup|
95 for getting rid of those.
Bram Moolenaar82cf9b62005-06-07 21:09:25 +000096
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +000097 *zW*
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +000098zW Like "zw" but add the word to the internal word list
99 |internal-wordlist|.
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000100
Bram Moolenaar87b5ca52006-03-04 21:55:31 +0000101zuw *zug* *zuw*
102zug Undo |zw| and |zg|, remove the word from the entry in
103 'spellfile'. Count used as with |zg|.
104
105zuW *zuG* *zuW*
106zuG Undo |zW| and |zG|, remove the word from the internal
107 word list. Count used as with |zg|.
108
Bram Moolenaar520470a2005-06-16 21:59:56 +0000109 *:spe* *:spellgood*
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000110:[count]spe[llgood] {word}
Bram Moolenaar53180ce2005-07-05 21:48:14 +0000111 Add {word} as a good word to 'spellfile', like with
Bram Moolenaar87b5ca52006-03-04 21:55:31 +0000112 |zg|. Without count the first name is used, with a
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000113 count of two the second entry, etc.
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000114
Bram Moolenaar53180ce2005-07-05 21:48:14 +0000115:spe[llgood]! {word} Add {word} as a good word to the internal word list,
Bram Moolenaar87b5ca52006-03-04 21:55:31 +0000116 like with |zG|.
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000117
Bram Moolenaar520470a2005-06-16 21:59:56 +0000118 *:spellw* *:spellwrong*
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000119:[count]spellw[rong] {word}
Bram Moolenaar53180ce2005-07-05 21:48:14 +0000120 Add {word} as a wrong (bad) word to 'spellfile', as
Bram Moolenaar87b5ca52006-03-04 21:55:31 +0000121 with |zw|. Without count the first name is used, with
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000122 a count of two the second entry, etc.
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000123
Bram Moolenaar53180ce2005-07-05 21:48:14 +0000124:spellw[rong]! {word} Add {word} as a wrong (bad) word to the internal word
Bram Moolenaar87b5ca52006-03-04 21:55:31 +0000125 list, like with |zW|.
126
127:[count]spellu[ndo] {word} *:spellu* *:spellundo*
128 Like |zuw|. [count] used as with |:spellgood|.
129
130:spellu[ndo]! {word} Like |zuW|. [count] used as with |:spellgood|.
131
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000132
Bram Moolenaarf461c8e2005-06-25 23:04:51 +0000133After adding a word to 'spellfile' with the above commands its associated
Bram Moolenaard042c562005-06-30 22:04:15 +0000134".spl" file will automatically be updated and reloaded. If you change
135'spellfile' manually you need to use the |:mkspell| command. This sequence of
136commands mostly works well: >
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000137 :edit <file in 'spellfile'>
Bram Moolenaarf461c8e2005-06-25 23:04:51 +0000138< (make changes to the spell file) >
139 :mkspell! %
140
141More details about the 'spellfile' format below |spell-wordlist-format|.
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000142
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000143 *internal-wordlist*
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000144The internal word list is used for all buffers where 'spell' is set. It is
145not stored, it is lost when you exit Vim. It is also cleared when 'encoding'
146is set.
147
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000148
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000149Finding suggestions for bad words:
Bram Moolenaarcc016f52005-12-10 20:23:46 +0000150 *z=*
151z= For the word under/after the cursor suggest correctly
Bram Moolenaard042c562005-06-30 22:04:15 +0000152 spelled words. This also works to find alternatives
153 for a word that is not highlighted as a bad word,
154 e.g., when the word after it is bad.
Bram Moolenaar7df351e2006-01-23 22:30:28 +0000155 In Visual mode the highlighted text is taken as the
156 word to be replaced.
157 The results are sorted on similarity to the word being
158 replaced.
Bram Moolenaar90915b52005-08-21 22:17:52 +0000159 This may take a long time. Hit CTRL-C when you get
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000160 bored.
Bram Moolenaar90915b52005-08-21 22:17:52 +0000161
162 If the command is used without a count the
163 alternatives are listed and you can enter the number
164 of your choice or press <Enter> if you don't want to
165 replace. You can also use the mouse to click on your
166 choice (only works if the mouse can be used in Normal
167 mode and when there are no line wraps). Click on the
168 first line (the header) to cancel.
169
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000170 The suggestions listed normally replace a highlighted
171 bad word. Sometimes they include other text, in that
172 case the replaced text is also listed after a "<".
173
Bram Moolenaar90915b52005-08-21 22:17:52 +0000174 If a count is used that suggestion is used, without
Bram Moolenaarcc016f52005-12-10 20:23:46 +0000175 prompting. For example, "1z=" always takes the first
Bram Moolenaar90915b52005-08-21 22:17:52 +0000176 suggestion.
177
178 If 'verbose' is non-zero a score will be displayed
179 with the suggestions to indicate the likeliness to the
180 badly spelled word (the higher the score the more
181 different).
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000182 When a word was replaced the redo command "." will
183 repeat the word replacement. This works like "ciw",
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000184 the good word and <Esc>. This does NOT work for Thai
185 and other languages without spaces between words.
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000186
Bram Moolenaar24bbcfe2005-06-28 23:32:02 +0000187 *:spellr* *:spellrepall* *E752* *E753*
Bram Moolenaarcc016f52005-12-10 20:23:46 +0000188:spellr[epall] Repeat the replacement done by |z=| for all matches
Bram Moolenaar24bbcfe2005-06-28 23:32:02 +0000189 with the replaced word in the current window.
190
Bram Moolenaar488c6512005-08-11 20:09:58 +0000191In Insert mode, when the cursor is after a badly spelled word, you can use
192CTRL-X s to find suggestions. This works like Insert mode completion. Use
193CTRL-N to use the next suggestion, CTRL-P to go back. |i_CTRL-X_s|
194
Bram Moolenaard857f0e2005-06-21 22:37:39 +0000195The 'spellsuggest' option influences how the list of suggestions is generated
196and sorted. See |'spellsuggest'|.
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000197
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000198The 'spellcapcheck' option is used to check the first word of a sentence
199starts with a capital. This doesn't work for the first word in the file.
200When there is a line break right after a sentence the highlighting of the next
Bram Moolenaar90cfdbe2005-08-12 19:59:19 +0000201line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for
202how it can be set automatically when 'spelllang' is set.
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000203
Bram Moolenaar4770d092006-01-12 23:22:24 +0000204Vim counts the number of times a good word is encountered. This is used to
205sort the suggestions: words that have been seen before get a small bonus,
206words that have been seen often get a bigger bonus. The COMMON item in the
207affix file can be used to define common words, so that this mechanism also
208works in a new or short file |spell-COMMON|.
209
Bram Moolenaard042c562005-06-30 22:04:15 +0000210==============================================================================
2112. Remarks on spell checking *spell-remarks*
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000212
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000213PERFORMANCE
214
Bram Moolenaard042c562005-06-30 22:04:15 +0000215Vim does on-the-fly spell checking. To make this work fast the word list is
216loaded in memory. Thus this uses a lot of memory (1 Mbyte or more). There
217might also be a noticeable delay when the word list is loaded, which happens
218when 'spell' is set and when 'spelllang' is set while 'spell' was already set.
219To minimize the delay each word list is only loaded once, it is not deleted
220when 'spelllang' is made empty or 'spell' is reset. When 'encoding' is set
221all the word lists are reloaded, thus you may notice a delay then too.
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000222
223
Bram Moolenaar217ad922005-03-20 22:37:15 +0000224REGIONS
225
226A word may be spelled differently in various regions. For example, English
227comes in (at least) these variants:
228
229 en all regions
Bram Moolenaar5c5474b2005-04-19 21:40:26 +0000230 en_au Australia
Bram Moolenaar217ad922005-03-20 22:37:15 +0000231 en_ca Canada
Bram Moolenaar5c5474b2005-04-19 21:40:26 +0000232 en_gb Great Britain
233 en_nz New Zealand
234 en_us USA
Bram Moolenaar217ad922005-03-20 22:37:15 +0000235
236Words that are not used in one region but are used in another region are
Bram Moolenaar520470a2005-06-16 21:59:56 +0000237highlighted with SpellLocal |hl-SpellLocal|.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000238
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000239Always use lowercase letters for the language and region names.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000240
Bram Moolenaar3638c682005-06-08 22:05:14 +0000241When adding a word with |zg| or another command it's always added for all
242regions. You can change that by manually editing the 'spellfile'. See
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000243|spell-wordlist-format|. Note that the regions as specified in the files in
Bram Moolenaar16d8f872005-11-26 23:46:11 +0000244'spellfile' are only used when all entries in 'spelllang' specify the same
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000245region (not counting files specified by their .spl name).
Bram Moolenaar3638c682005-06-08 22:05:14 +0000246
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000247 *spell-german*
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000248Specific exception: For German these special regions are used:
249 de all German words accepted
250 de_de old and new spelling
251 de_19 old spelling
252 de_20 new spelling
253 de_at Austria
254 de_ch Switzerland
255
Bram Moolenaar92d640f2005-09-05 22:11:52 +0000256 *spell-russian*
257Specific exception: For Russian these special regions are used:
258 ru all Russian words accepted
259 ru_ru "IE" letter spelling
260 ru_yo "YO" letter spelling
261
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000262 *spell-yiddish*
263Yiddish requires using "utf-8" encoding, because of the special characters
264used. If you are using latin1 Vim will use transliterated (romanized) Yiddish
265instead. If you want to use transliterated Yiddish with utf-8 use "yi-tr".
266In a table:
267 'encoding' 'spelllang'
268 utf-8 yi Yiddish
269 latin1 yi transliterated Yiddish
270 utf-8 yi-tr transliterated Yiddish
271
Bram Moolenaar217ad922005-03-20 22:37:15 +0000272
Bram Moolenaar3b506942005-06-23 22:36:45 +0000273SPELL FILES *spell-load*
Bram Moolenaar217ad922005-03-20 22:37:15 +0000274
275Vim searches for spell files in the "spell" subdirectory of the directories in
Bram Moolenaar3638c682005-06-08 22:05:14 +0000276'runtimepath'. The name is: LL.EEE.spl, where:
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000277 LL the language name
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000278 EEE the value of 'encoding'
Bram Moolenaar217ad922005-03-20 22:37:15 +0000279
Bram Moolenaar3b506942005-06-23 22:36:45 +0000280The value for "LL" comes from 'spelllang', but excludes the region name.
281Examples:
282 'spelllang' LL ~
283 en_us en
284 en-rare en-rare
285 medical_ca medical
286
Bram Moolenaar3638c682005-06-08 22:05:14 +0000287Only the first file is loaded, the one that is first in 'runtimepath'. If
288this succeeds then additionally files with the name LL.EEE.add.spl are loaded.
289All the ones that are found are used.
290
Bram Moolenaar1ef15e32006-02-01 21:56:25 +0000291If no spell file is found the |SpellFileMissing| autocommand event is
292triggered. This may trigger the |spellfile.vim| plugin to offer you
293downloading the spell file.
294
Bram Moolenaar0d9c26d2005-07-02 23:19:16 +0000295Additionally, the files related to the names in 'spellfile' are loaded. These
296are the files that |zg| and |zw| add good and wrong words to.
Bram Moolenaar3b506942005-06-23 22:36:45 +0000297
Bram Moolenaar0e21a3f2005-04-17 20:28:32 +0000298Exceptions:
299- Vim uses "latin1" when 'encoding' is "iso-8859-15". The euro sign doesn't
300 matter for spelling.
301- When no spell file for 'encoding' is found "ascii" is tried. This only
302 works for languages where nearly all words are ASCII, such as English. It
303 helps when 'encoding' is not "latin1", such as iso-8859-2, and English text
Bram Moolenaar3638c682005-06-08 22:05:14 +0000304 is being edited. For the ".add" files the same name as the found main
305 spell file is used.
306
307For example, with these values:
308 'runtimepath' is "~/.vim,/usr/share/vim70,~/.vim/after"
309 'encoding' is "iso-8859-2"
310 'spelllang' is "pl"
311
312Vim will look for:
3131. ~/.vim/spell/pl.iso-8859-2.spl
3142. /usr/share/vim70/spell/pl.iso-8859-2.spl
3153. ~/.vim/spell/pl.iso-8859-2.add.spl
3164. /usr/share/vim70/spell/pl.iso-8859-2.add.spl
3175. ~/.vim/after/spell/pl.iso-8859-2.add.spl
318
319This assumes 1. is not found and 2. is found.
320
321If 'encoding' is "latin1" Vim will look for:
3221. ~/.vim/spell/pl.latin1.spl
3232. /usr/share/vim70/spell/pl.latin1.spl
3243. ~/.vim/after/spell/pl.latin1.spl
3254. ~/.vim/spell/pl.ascii.spl
3265. /usr/share/vim70/spell/pl.ascii.spl
3276. ~/.vim/after/spell/pl.ascii.spl
328
329This assumes none of them are found (Polish doesn't make sense when leaving
330out the non-ASCII characters).
Bram Moolenaar217ad922005-03-20 22:37:15 +0000331
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000332Spelling for EBCDIC is currently not supported.
333
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000334A spell file might not be available in the current 'encoding'. See
335|spell-mkspell| about how to create a spell file. Converting a spell file
Bram Moolenaar0e21a3f2005-04-17 20:28:32 +0000336with "iconv" will NOT work!
Bram Moolenaar217ad922005-03-20 22:37:15 +0000337
Bram Moolenaara40ceaf2006-01-13 22:35:40 +0000338 *spell-sug-file* *E781*
Bram Moolenaar4770d092006-01-12 23:22:24 +0000339If there is a file with exactly the same name as the ".spl" file but ending in
340".sug", that file will be used for giving better suggestions. It isn't loaded
341before suggestions are made to reduce memory use.
342
Bram Moolenaara40ceaf2006-01-13 22:35:40 +0000343 *E758* *E759* *E778* *E779* *E780* *E782*
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000344When loading a spell file Vim checks that it is properly formatted. If you
Bram Moolenaar0e21a3f2005-04-17 20:28:32 +0000345get an error the file may be truncated, modified or intended for another Vim
346version.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000347
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000348
Bram Moolenaar87b5ca52006-03-04 21:55:31 +0000349SPELLFILE CLEANUP *spellfile-cleanup*
350
351The |zw| command turns existing entries in 'spellfile' into comment lines.
352This avoids having to write a new file every time, but results in the file
353only getting longer, never shorter. To clean up the comment lines in all
354".add" spell files do this: >
355 :runtime spell/cleanadd.vim
356
357This deletes all comment lines, except the ones that start with "##". Use
358"##" lines to add comments that you want to keep.
359
360You can invoke this script as often as you like. A variable is provided to
361skip updating files that have been changed recently. Set it to the number of
362seconds that has passed since a file was changed before it will be cleaned.
363For example, to clean only files that were not changed in the last hour: >
364 let g:spell_clean_limit = 60 * 60
365The default is one second.
366
367
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000368WORDS
369
370Vim uses a fixed method to recognize a word. This is independent of
371'iskeyword', so that it also works in help files and for languages that
372include characters like '-' in 'iskeyword'. The word characters do depend on
373'encoding'.
374
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000375The table with word characters is stored in the main .spl file. Therefore it
376matters what the current locale is when generating it! A .add.spl file does
Bram Moolenaarf461c8e2005-06-25 23:04:51 +0000377not contain a word table though.
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000378
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000379For a word that starts with a digit the digit is ignored, unless the word as a
380whole is recognized. Thus if "3D" is a word and "D" is not then "3D" is
381recognized as a word, but if "3D" is not a word then only the "D" is marked as
382bad. Hex numbers in the form 0x12ab and 0X12AB are recognized.
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000383
384
Bram Moolenaar30abd282005-06-22 22:35:10 +0000385WORD COMBINATIONS
386
387It is possible to spell-check words that include a space. This is used to
388recognize words that are invalid when used by themselves, e.g. for "et al.".
389It can also be used to recognize "the the" and highlight it.
390
391The number of spaces is irrelevant. In most cases a line break may also
392appear. However, this makes it difficult to find out where to start checking
393for spelling mistakes. When you make a change to one line and only that line
394is redrawn Vim won't look in the previous line, thus when "et" is at the end
395of the previous line "al." will be flagged as an error. And when you type
396"the<CR>the" the highlighting doesn't appear until the first line is redrawn.
397Use |CTRL-L| to redraw right away. "[s" will also stop at a word combination
398with a line break.
399
400When encountering a line break Vim skips characters such as '*', '>' and '"',
401so that comments in C, shell and Vim code can be spell checked.
402
403
Bram Moolenaar9d0ec2e2005-04-20 19:45:58 +0000404SYNTAX HIGHLIGHTING *spell-syntax*
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000405
406Files that use syntax highlighting can specify where spell checking should be
407done:
408
Bram Moolenaar3638c682005-06-08 22:05:14 +00004091. everywhere default
4102. in specific items use "contains=@Spell"
4113. everywhere but specific items use "contains=@NoSpell"
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000412
Bram Moolenaar3638c682005-06-08 22:05:14 +0000413For the second method adding the @NoSpell cluster will disable spell checking
414again. This can be used, for example, to add @Spell to the comments of a
415program, and add @NoSpell for items that shouldn't be checked.
Bram Moolenaarc81e5e72007-05-05 18:24:42 +0000416Also see |:syn-spell| for text that is not in a syntax item.
Bram Moolenaar6bb68362005-03-22 23:03:44 +0000417
Bram Moolenaar30abd282005-06-22 22:35:10 +0000418
419VIM SCRIPTS
420
421If you want to write a Vim script that does something with spelling, you may
422find these functions useful:
423
424 spellbadword() find badly spelled word at the cursor
425 spellsuggest() get list of spelling suggestions
Bram Moolenaard042c562005-06-30 22:04:15 +0000426 soundfold() get the sound-a-like version of a word
Bram Moolenaar30abd282005-06-22 22:35:10 +0000427
Bram Moolenaar90cfdbe2005-08-12 19:59:19 +0000428
429SETTING 'spellcapcheck' AUTOMATICALLY *set-spc-auto*
430
431After the 'spelllang' option has been set successfully, Vim will source the
432files "spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang'
433up to the first comma, dot or underscore. This can be used to set options
434specifically for the language, especially 'spellcapcheck'.
435
436The distribution includes a few of these files. Use this command to see what
437they do: >
438 :next $VIMRUNTIME/spell/*.vim
439
440Note that the default scripts don't set 'spellcapcheck' if it was changed from
441the default value. This assumes the user prefers another value then.
442
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000443
444DOUBLE SCORING *spell-double-scoring*
445
446The 'spellsuggest' option can be used to select "double" scoring. This
447mechanism is based on the principle that there are two kinds of spelling
448mistakes:
449
4501. You know how to spell the word, but mistype something. This results in a
451 small editing distance (character swapped/omitted/inserted) and possibly a
452 word that sounds completely different.
453
4542. You don't know how to spell the word and type something that sounds right.
455 The edit distance can be big but the word is similar after sound-folding.
456
457Since scores for these two mistakes will be very different we use a list
458for each and mix them.
459
460The sound-folding is slow and people that know the language won't make the
461second kind of mistakes. Therefore 'spellsuggest' can be set to select the
462preferred method for scoring the suggestions.
463
Bram Moolenaar217ad922005-03-20 22:37:15 +0000464==============================================================================
Bram Moolenaard042c562005-06-30 22:04:15 +00004653. Generating a spell file *spell-mkspell*
Bram Moolenaar217ad922005-03-20 22:37:15 +0000466
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000467Vim uses a binary file format for spelling. This greatly speeds up loading
468the word list and keeps it small.
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +0000469 *.aff* *.dic* *Myspell*
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000470You can create a Vim spell file from the .aff and .dic files that Myspell
471uses. Myspell is used by OpenOffice.org and Mozilla. You should be able to
472find them here:
Bram Moolenaarc81e5e72007-05-05 18:24:42 +0000473 http://wiki.services.openoffice.org/wiki/Dictionaries
Bram Moolenaar30abd282005-06-22 22:35:10 +0000474You can also use a plain word list. The results are the same, the choice
Bram Moolenaard042c562005-06-30 22:04:15 +0000475depends on what word lists you can find.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000476
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000477If you install Aap (from www.a-a-p.org) you can use the recipes in the
478runtime/spell/??/ directories. Aap will take care of downloading the files,
479apply patches needed for Vim and build the .spl file.
480
Bram Moolenaare13305e2005-06-19 22:54:15 +0000481Make sure your current locale is set properly, otherwise Vim doesn't know what
482characters are upper/lower case letters. If the locale isn't available (e.g.,
483when using an MS-Windows codepage on Unix) add tables to the .aff file
Bram Moolenaar3b506942005-06-23 22:36:45 +0000484|spell-affix-chars|. If the .aff file doesn't define a table then the word
485table of the currently active spelling is used. If spelling is not active
486then Vim will try to guess.
Bram Moolenaare13305e2005-06-19 22:54:15 +0000487
Bram Moolenaar3b506942005-06-23 22:36:45 +0000488 *:mksp* *:mkspell*
489:mksp[ell][!] [-ascii] {outname} {inname} ...
Bram Moolenaar16d8f872005-11-26 23:46:11 +0000490 Generate a Vim spell file from word lists. Example: >
Bram Moolenaard042c562005-06-30 22:04:15 +0000491 :mkspell /tmp/nl nl_NL.words
Bram Moolenaar3b506942005-06-23 22:36:45 +0000492< *E751*
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000493 When {outname} ends in ".spl" it is used as the output
494 file name. Otherwise it should be a language name,
Bram Moolenaar3b506942005-06-23 22:36:45 +0000495 such as "en", without the region name. The file
496 written will be "{outname}.{encoding}.spl", where
497 {encoding} is the value of the 'encoding' option.
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000498
Bram Moolenaard042c562005-06-30 22:04:15 +0000499 When the output file already exists [!] must be used
Bram Moolenaar520470a2005-06-16 21:59:56 +0000500 to overwrite it.
501
Bram Moolenaar0e21a3f2005-04-17 20:28:32 +0000502 When the [-ascii] argument is present, words with
503 non-ascii characters are skipped. The resulting file
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000504 ends in "ascii.spl".
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000505
506 The input can be the Myspell format files {inname}.aff
507 and {inname}.dic. If {inname}.aff does not exist then
508 {inname} is used as the file name of a plain word
509 list.
510
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000511 Multiple {inname} arguments can be given to combine
512 regions into one Vim spell file. Example: >
513 :mkspell ~/.vim/spell/en /tmp/en_US /tmp/en_CA /tmp/en_AU
514< This combines the English word lists for US, CA and AU
515 into one en.spl file.
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000516 Up to eight regions can be combined. *E754* *E755*
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000517 The REP and SAL items of the first .aff file where
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000518 they appear are used. |spell-REP| |spell-SAL|
Bram Moolenaar217ad922005-03-20 22:37:15 +0000519
Bram Moolenaar30abd282005-06-22 22:35:10 +0000520 This command uses a lot of memory, required to find
Bram Moolenaar8aff23a2005-08-19 20:40:30 +0000521 the optimal word tree (Polish, Italian and Hungarian
522 require several hundred Mbyte). The final result will
523 be much smaller, because compression is used. To
524 avoid running out of memory compression will be done
525 now and then. This can be tuned with the 'mkspellmem'
526 option.
Bram Moolenaar30abd282005-06-22 22:35:10 +0000527
Bram Moolenaard042c562005-06-30 22:04:15 +0000528 After the spell file was written and it was being used
529 in a buffer it will be reloaded automatically.
Bram Moolenaar45eeb132005-06-06 21:59:07 +0000530
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +0000531:mksp[ell] [-ascii] {name}.{enc}.add
532 Like ":mkspell" above, using {name}.{enc}.add as the
Bram Moolenaard042c562005-06-30 22:04:15 +0000533 input file and producing an output file in the same
534 directory that has ".spl" appended.
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +0000535
536:mksp[ell] [-ascii] {name}
537 Like ":mkspell" above, using {name} as the input file
Bram Moolenaard042c562005-06-30 22:04:15 +0000538 and producing an output file in the same directory
539 that has ".{enc}.spl" appended.
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000540
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000541Vim will report the number of duplicate words. This might be a mistake in the
542list of words. But sometimes it is used to have different prefixes and
543suffixes for the same basic word to avoid them combining (e.g. Czech uses
Bram Moolenaar8aff23a2005-08-19 20:40:30 +0000544this). If you want Vim to report all duplicate words set the 'verbose'
545option.
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000546
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000547Since you might want to change a Myspell word list for use with Vim the
548following procedure is recommended:
Bram Moolenaar217ad922005-03-20 22:37:15 +0000549
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +00005501. Obtain the xx_YY.aff and xx_YY.dic files from Myspell.
5512. Make a copy of these files to xx_YY.orig.aff and xx_YY.orig.dic.
5523. Change the xx_YY.aff and xx_YY.dic files to remove bad words, add missing
Bram Moolenaar0cb032e2005-04-23 20:52:00 +0000553 words, define word characters with FOL/LOW/UPP, etc. The distributed
Bram Moolenaarc81e5e72007-05-05 18:24:42 +0000554 "*.diff" files can be used.
Bram Moolenaard042c562005-06-30 22:04:15 +00005554. Start Vim with the right locale and use |:mkspell| to generate the Vim
556 spell file.
5575. Try out the spell file with ":set spell spelllang=xx" if you wrote it in
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000558 a spell directory in 'runtimepath', or ":set spelllang=xx.enc.spl" if you
Bram Moolenaard042c562005-06-30 22:04:15 +0000559 wrote it somewhere else.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000560
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000561When the Myspell files are updated you can merge the differences:
Bram Moolenaar0cb032e2005-04-23 20:52:00 +00005621. Obtain the new Myspell files as xx_YY.new.aff and xx_UU.new.dic.
5632. Use Vimdiff to see what changed: >
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000564 vimdiff xx_YY.orig.dic xx_YY.new.dic
Bram Moolenaar0cb032e2005-04-23 20:52:00 +00005653. Take over the changes you like in xx_YY.dic.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000566 You may also need to change xx_YY.aff.
Bram Moolenaar0cb032e2005-04-23 20:52:00 +00005674. Rename xx_YY.new.dic to xx_YY.orig.dic and xx_YY.new.aff to xx_YY.new.aff.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000568
Bram Moolenaar3b506942005-06-23 22:36:45 +0000569
Bram Moolenaar8aff23a2005-08-19 20:40:30 +0000570SPELL FILE VERSIONS *E770* *E771* *E772*
571
572Spell checking is a relatively new feature in Vim, thus it's possible that the
573.spl file format will be changed to support more languages. Vim will check
574the validity of the spell file and report anything wrong.
575
576 E771: Old spell file, needs to be updated ~
577This spell file is older than your Vim. You need to update the .spl file.
578
579 E772: Spell file is for newer version of Vim ~
580This means the spell file was made for a later version of Vim. You need to
581update Vim.
582
583 E770: Unsupported section in spell file ~
584This means the spell file was made for a later version of Vim and contains a
585section that is required for the spell file to work. In this case it's
586probably a good idea to upgrade your Vim.
587
588
Bram Moolenaar3b506942005-06-23 22:36:45 +0000589SPELL FILE DUMP
590
591If for some reason you want to check what words are supported by the currently
592used spelling files, use this command:
593
594 *:spelldump* *:spelld*
595:spelld[ump] Open a new window and fill it with all currently valid
Bram Moolenaarac6e65f2005-08-29 22:25:38 +0000596 words. Compound words are not included.
Bram Moolenaard042c562005-06-30 22:04:15 +0000597 Note: For some languages the result may be enormous,
598 causing Vim to run out of memory.
Bram Moolenaar3b506942005-06-23 22:36:45 +0000599
Bram Moolenaar4770d092006-01-12 23:22:24 +0000600:spelld[ump]! Like ":spelldump" and include the word count. This is
601 the number of times the word was found while
602 updating the screen. Words that are in COMMON items
603 get a starting count of 10.
604
Bram Moolenaar3b506942005-06-23 22:36:45 +0000605The format of the word list is used |spell-wordlist-format|. You should be
606able to read it with ":mkspell" to generate one .spl file that includes all
607the words.
608
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000609When all entries to 'spelllang' use the same regions or no regions at all then
610the region information is included in the dumped words. Otherwise only words
611for the current region are included and no "/regions" line is generated.
Bram Moolenaar3b506942005-06-23 22:36:45 +0000612
Bram Moolenaard042c562005-06-30 22:04:15 +0000613Comment lines with the name of the .spl file are used as a header above the
614words that were generated from that .spl file.
Bram Moolenaar3b506942005-06-23 22:36:45 +0000615
Bram Moolenaar1ef15e32006-02-01 21:56:25 +0000616
617SPELL FILE MISSING *spell-SpellFileMissing* *spellfile.vim*
618
619If the spell file for the language you are using is not available, you will
620get an error message. But if the "spellfile.vim" plugin is active it will
621offer you to download the spell file. Just follow the instructions, it will
622ask you where to write the file.
623
624The plugin has a default place where to look for spell files, on the Vim ftp
625server. If you want to use another location or another protocol, set the
626g:spellfile_URL variable to the directory that holds the spell files. The
627|netrw| plugin is used for getting the file, look there for the speficic
628syntax of the URL. Example: >
629 let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
630You may need to escape special characters.
631
632The plugin will only ask about downloading a language once. If you want to
633try again anyway restart Vim, or set g:spellfile_URL to another value (e.g.,
634prepend a space).
635
636To avoid using the "spellfile.vim" plugin do this in your vimrc file: >
637
638 let loaded_spellfile_plugin = 1
639
640Instead of using the plugin you can define a |SpellFileMissing| autocommand to
641handle the missing file yourself. You can use it like this: >
642
643 :au SpellFileMissing * call Download_spell_file(expand('<amatch>'))
644
645Thus the <amatch> item contains the name of the language. Another important
646value is 'encoding', since every encoding has its own spell file. With two
647exceptions:
648- For ISO-8859-15 (latin9) the name "latin1" is used (the encodings only
649 differ in characters not used in dictionary words).
650- The name "ascii" may also be used for some languages where the words use
651 only ASCII letters for most of the words.
652
653The default "spellfile.vim" plugin uses this autocommand, if you define your
Bram Moolenaarc81e5e72007-05-05 18:24:42 +0000654autocommand afterwards you may want to use ":au! SpellFileMissing" to overrule
Bram Moolenaar1ef15e32006-02-01 21:56:25 +0000655it. If you define your autocommand before the plugin is loaded it will notice
656this and not do anything.
657
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000658==============================================================================
Bram Moolenaard042c562005-06-30 22:04:15 +00006594. Spell file format *spell-file-format*
Bram Moolenaar217ad922005-03-20 22:37:15 +0000660
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000661This is the format of the files that are used by the person who creates and
662maintains a word list.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000663
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000664Note that we avoid the word "dictionary" here. That is because the goal of
665spell checking differs from writing a dictionary (as in the book). For
Bram Moolenaar16d8f872005-11-26 23:46:11 +0000666spelling we need a list of words that are OK, thus should not be highlighted.
667Person and company names will not appear in a dictionary, but do appear in a
668word list. And some old words are rarely used while they are common
669misspellings. These do appear in a dictionary but not in a word list.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000670
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000671There are two formats: A straight list of words and a list using affix
Bram Moolenaard042c562005-06-30 22:04:15 +0000672compression. The files with affix compression are used by Myspell (Mozilla
673and OpenOffice.org). This requires two files, one with .aff and one with .dic
674extension.
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000675
676
Bram Moolenaard042c562005-06-30 22:04:15 +0000677FORMAT OF STRAIGHT WORD LIST *spell-wordlist-format*
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000678
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000679The words must appear one per line. That is all that is required.
Bram Moolenaard042c562005-06-30 22:04:15 +0000680
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000681Additionally the following items are recognized:
Bram Moolenaard042c562005-06-30 22:04:15 +0000682
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000683- Empty and blank lines are ignored.
Bram Moolenaard042c562005-06-30 22:04:15 +0000684
Bram Moolenaar4770d092006-01-12 23:22:24 +0000685 # comment ~
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000686- Lines starting with a # are ignored (comment lines).
Bram Moolenaard042c562005-06-30 22:04:15 +0000687
Bram Moolenaar4770d092006-01-12 23:22:24 +0000688 /encoding=utf-8 ~
Bram Moolenaar45eeb132005-06-06 21:59:07 +0000689- A line starting with "/encoding=", before any word, specifies the encoding
690 of the file. After the second '=' comes an encoding name. This tells Vim
Bram Moolenaard042c562005-06-30 22:04:15 +0000691 to setup conversion from the specified encoding to 'encoding'. Thus you can
692 use one word list for several target encodings.
693
Bram Moolenaar4770d092006-01-12 23:22:24 +0000694 /regions=usca ~
Bram Moolenaar3638c682005-06-08 22:05:14 +0000695- A line starting with "/regions=" specifies the region names that are
696 supported. Each region name must be two ASCII letters. The first one is
697 region 1. Thus "/regions=usca" has region 1 "us" and region 2 "ca".
Bram Moolenaard042c562005-06-30 22:04:15 +0000698 In an addition word list the region names should be equal to the main word
699 list!
700
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000701- Other lines starting with '/' are reserved for future use. The ones that
Bram Moolenaar4770d092006-01-12 23:22:24 +0000702 are not recognized are ignored. You do get a warning message, so that you
703 know something won't work.
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000704
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000705- A "/" may follow the word with the following items:
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000706 = Case must match exactly.
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000707 ? Rare word.
708 ! Bad (wrong) word.
709 digit A region in which the word is valid. If no regions are
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000710 specified the word is valid in all regions.
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000711
Bram Moolenaar3638c682005-06-08 22:05:14 +0000712Example:
713
714 # This is an example word list comment
715 /encoding=latin1 encoding of the file
716 /regions=uscagb regions "us", "ca" and "gb"
717 example word for all regions
Bram Moolenaar1f8a5f02005-07-01 22:41:52 +0000718 blah/12 word for regions "us" and "ca"
719 vim/! bad word
720 Campbell/?3 rare word in region 3 "gb"
721 's mornings/= keep-case word
Bram Moolenaar3638c682005-06-08 22:05:14 +0000722
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000723Note that when "/=" is used the same word with all upper-case letters is not
724accepted. This is different from a word with mixed case that is automatically
725marked as keep-case, those words may appear in all upper-case letters.
726
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000727
Bram Moolenaar8dff8182006-04-06 20:18:50 +0000728FORMAT WITH .AFF AND .DIC FILES *aff-dic-format*
Bram Moolenaar75c50c42005-06-04 22:06:24 +0000729
Bram Moolenaar4770d092006-01-12 23:22:24 +0000730There are two files: the basic word list and an affix file. The affix file
731specifies settings for the language and can contain affixes. The affixes are
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000732used to modify the basic words to get the full word list. This significantly
733reduces the number of words, especially for a language like Polish. This is
734called affix compression.
Bram Moolenaar217ad922005-03-20 22:37:15 +0000735
Bram Moolenaar4770d092006-01-12 23:22:24 +0000736The basic word list and the affix file are combined with the ":mkspell"
737command and results in a binary spell file. All the preprocessing has been
738done, thus this file loads fast. The binary spell file format is described in
739the source code (src/spell.c). But only developers need to know about it.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000740
741The preprocessing also allows us to take the Myspell language files and modify
742them before the Vim word list is made. The tools for this can be found in the
743"src/spell" directory.
744
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000745The format for the affix and word list files is based on what Myspell uses
746(the spell checker of Mozilla and OpenOffice.org). A description can be found
747here:
748 http://lingucomponent.openoffice.org/affix.readme ~
749Note that affixes are case sensitive, this isn't obvious from the description.
750
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000751Vim supports quite a few extras. They are described below |spell-affix-vim|.
752Attempts have been made to keep this compatible with other spell checkers, so
Bram Moolenaar4770d092006-01-12 23:22:24 +0000753that the same files can often be used. One other project that offers more
754than Myspell is Hunspell ( http://hunspell.sf.net ).
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000755
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000756
Bram Moolenaar3638c682005-06-08 22:05:14 +0000757WORD LIST FORMAT *spell-dic-format*
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000758
Bram Moolenaar4770d092006-01-12 23:22:24 +0000759A short example, with line numbers:
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000760
Bram Moolenaar4770d092006-01-12 23:22:24 +0000761 1 1234 ~
762 2 aan ~
763 3 Als ~
764 4 Etten-Leur ~
765 5 et al. ~
766 6 's-Gravenhage ~
767 7 's-Gravenhaags ~
768 8 # word that differs between regions ~
769 9 kado/1 ~
770 10 cadeau/2 ~
771 11 TCP,IP ~
772 12 /the S affix may add a 's' ~
773 13 bedel/S ~
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000774
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000775The first line contains the number of words. Vim ignores it, but you do get
776an error message if it's not there. *E760*
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000777
Bram Moolenaar4770d092006-01-12 23:22:24 +0000778What follows is one word per line. White space at the end of the line is
779ignored, all other white space matters. The encoding is specified in the
780affix file |spell-SET|.
781
782Comment lines start with '#' or '/'. See the example lines 8 and 12. Note
783that putting a comment after a word is NOT allowed:
784
785 someword # comment that causes an error! ~
786
787After the word there is an optional slash and flags. Most of these flags are
788letters that indicate the affixes that can be used with this word. These are
789specified with SFX and PFX lines in the .aff file, see |spell-SFX| and
790|spell-PFX|. Vim allows using other flag types with the FLAG item in the
791affix file |spell-FLAG|.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000792
793When the word only has lower-case letters it will also match with the word
794starting with an upper-case letter.
795
796When the word includes an upper-case letter, this means the upper-case letter
797is required at this position. The same word with a lower-case letter at this
798position will not match. When some of the other letters are upper-case it will
799not match either.
800
Bram Moolenaar4770d092006-01-12 23:22:24 +0000801The word with all upper-case characters will always be OK,
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000802
803 word list matches does not match ~
804 als als Als ALS ALs AlS aLs aLS
805 Als Als ALS als ALs AlS aLs aLS
806 ALS ALS als Als ALs AlS aLs aLS
807 AlS AlS ALS als Als ALs aLs aLS
808
Bram Moolenaar1cbe5f72005-12-29 22:51:09 +0000809The KEEPCASE affix ID can be used to specifically match a word with identical
810case only, see below |spell-KEEPCASE|.
Bram Moolenaar45eeb132005-06-06 21:59:07 +0000811
Bram Moolenaar4770d092006-01-12 23:22:24 +0000812Note: in line 5 to 7 non-word characters are used. You can include any
813character in a word. When checking the text a word still only matches when it
814appears with a non-word character before and after it. For Myspell a word
815starting with a non-word character probably won't work.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000816
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000817In line 12 the word "TCP/IP" is defined. Since the slash has a special
818meaning the comma is used instead. This is defined with the SLASH item in the
Bram Moolenaar4770d092006-01-12 23:22:24 +0000819affix file, see |spell-SLASH|. Note that without this SLASH item the word
820will be "TCP,IP".
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000821
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000822
Bram Moolenaar4770d092006-01-12 23:22:24 +0000823AFFIX FILE FORMAT *spell-aff-format* *spell-affix-vim*
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000824
Bram Moolenaar4770d092006-01-12 23:22:24 +0000825 *spell-affix-comment*
826Comment lines in the .aff file start with a '#':
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000827
Bram Moolenaar4770d092006-01-12 23:22:24 +0000828 # comment line ~
829
830With some items it's also possible to put a comment after it, but this isn't
831supported in general.
832
833
834ENCODING *spell-SET*
835
836The affix file can be in any encoding that is supported by "iconv". However,
837in some cases the current locale should also be set properly at the time
838|:mkspell| is invoked. Adding FOL/LOW/UPP lines removes this requirement
839|spell-FOL|.
840
841The encoding should be specified before anything where the encoding matters.
842The encoding applies both to the affix file and the dictionary file. It is
843done with a SET line:
844
845 SET utf-8 ~
846
847The encoding can be different from the value of the 'encoding' option at the
848time ":mkspell" is used. Vim will then convert everything to 'encoding' and
849generate a spell file for 'encoding'. If some of the used characters to not
850fit in 'encoding' you will get an error message.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000851 *spell-affix-mbyte*
Bram Moolenaar4770d092006-01-12 23:22:24 +0000852When using a multi-byte encoding it's possible to use more different affix
853flags. But Myspell doesn't support that, thus you may not want to use it
854anyway. For compatibility use an 8-bit encoding.
Bram Moolenaar13fcaaf2005-04-15 21:13:42 +0000855
Bram Moolenaare13305e2005-06-19 22:54:15 +0000856
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000857INFORMATION
858
859These entries in the affix file can be used to add information to the spell
860file. There are no restrictions on the format, but they should be in the
861right encoding.
862
863 *spell-NAME* *spell-VERSION* *spell-HOME*
864 *spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT*
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000865 NAME Name of the language
866 VERSION 1.0.1 with fixes
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000867 HOME http://www.myhome.eu
868 AUTHOR John Doe
869 EMAIL john AT Doe DOT net
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000870 COPYRIGHT LGPL
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000871
872These fields are put in the .spl file as-is. The |:spellinfo| command can be
873used to view the info.
874
875 *:spellinfo* *:spelli*
876:spelli[nfo] Display the information for the spell file(s) used for
877 the current buffer.
878
879
Bram Moolenaare13305e2005-06-19 22:54:15 +0000880CHARACTER TABLES
Bram Moolenaar0cb032e2005-04-23 20:52:00 +0000881 *spell-affix-chars*
Bram Moolenaar82cf9b62005-06-07 21:09:25 +0000882When using an 8-bit encoding the affix file should define what characters are
Bram Moolenaar4770d092006-01-12 23:22:24 +0000883word characters. This is because the system where ":mkspell" is used may not
884support a locale with this encoding and isalpha() won't work. For example
885when using "cp1250" on Unix.
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000886 *E761* *E762* *spell-FOL*
887 *spell-LOW* *spell-UPP*
Bram Moolenaar0cb032e2005-04-23 20:52:00 +0000888Three lines in the affix file are needed. Simplistic example:
889
Bram Moolenaare13305e2005-06-19 22:54:15 +0000890 FOL áëñ ~
891 LOW áëñ ~
892 UPP ÁËÑ ~
Bram Moolenaar0cb032e2005-04-23 20:52:00 +0000893
894All three lines must have exactly the same number of characters.
895
896The "FOL" line specifies the case-folded characters. These are used to
897compare words while ignoring case. For most encodings this is identical to
898the lower case line.
899
900The "LOW" line specifies the characters in lower-case. Mostly it's equal to
901the "FOL" line.
902
903The "UPP" line specifies the characters with upper-case. That is, a character
904is upper-case where it's different from the character at the same position in
905"FOL".
906
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000907An exception is made for the German sharp s ß. The upper-case version is
908"SS". In the FOL/LOW/UPP lines it should be included, so that it's recognized
909as a word character, but use the ß character in all three.
910
Bram Moolenaar0cb032e2005-04-23 20:52:00 +0000911ASCII characters should be omitted, Vim always handles these in the same way.
912When the encoding is UTF-8 no word characters need to be specified.
913
914 *E763*
Bram Moolenaar3b506942005-06-23 22:36:45 +0000915Vim allows you to use spell checking for several languages in the same file.
916You can list them in the 'spelllang' option. As a consequence all spell files
917for the same encoding must use the same word characters, otherwise they can't
918be combined without errors. If you get a warning that the word tables differ
919you may need to generate the .spl file again with |:mkspell|. Check the FOL,
920LOW and UPP lines in the used .aff file.
921
922The XX.ascii.spl spell file generated with the "-ascii" argument will not
923contain the table with characters, so that it can be combine with spell files
924for any encoding. The .add.spl files also do not contain the table.
Bram Moolenaar0cb032e2005-04-23 20:52:00 +0000925
Bram Moolenaare7566042005-06-17 22:00:15 +0000926
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +0000927MID-WORD CHARACTERS
928 *spell-midword*
929Some characters are only to be considered word characters if they are used in
930between two ordinary word characters. An example is the single quote: It is
931often used to put text in quotes, thus it can't be recognized as a word
932character, but when it appears in between word characters it must be part of
933the word. This is needed to detect a spelling error such as they'are. That
934should be they're, but since "they" and "are" are words themselves that would
935go unnoticed.
936
Bram Moolenaar4770d092006-01-12 23:22:24 +0000937These characters are defined with MIDWORD in the .aff file. Example:
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +0000938
939 MIDWORD '- ~
940
941
Bram Moolenaar6e7c7f32005-08-24 22:16:11 +0000942FLAG TYPES *spell-FLAG*
943
944Flags are used to specify the affixes that can be used with a word and for
945other properties of the word. Normally single-character flags are used. This
946limits the number of possible flags, especially for 8-bit encodings. The FLAG
947item can be used if more affixes are to be used. Possible values:
948
949 FLAG long use two-character flags
950 FLAG num use numbers, from 1 up to 65000
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +0000951 FLAG caplong use one-character flags without A-Z and two-character
Bram Moolenaar6e7c7f32005-08-24 22:16:11 +0000952 flags that start with A-Z
953
954With "FLAG num" the numbers in a list of affixes need to be separated with a
955comma: "234,2143,1435". This method is inefficient, but useful if the file is
956generated with a program.
957
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +0000958When using "caplong" the two-character flags all start with a capital: "Aa",
959"B1", "BB", etc. This is useful to use one-character flags for the most
960common items and two-character flags for uncommon items.
Bram Moolenaar6e7c7f32005-08-24 22:16:11 +0000961
962Note: When using utf-8 only characters up to 65000 may be used for flags.
963
964
Bram Moolenaare13305e2005-06-19 22:54:15 +0000965AFFIXES
Bram Moolenaar6f16eb82005-08-23 21:02:42 +0000966 *spell-PFX* *spell-SFX*
Bram Moolenaare13305e2005-06-19 22:54:15 +0000967The usual PFX (prefix) and SFX (suffix) lines are supported (see the Myspell
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +0000968documentation or the Aspell manual:
969http://aspell.net/man-html/Affix-Compression.html).
Bram Moolenaare13305e2005-06-19 22:54:15 +0000970
Bram Moolenaar4770d092006-01-12 23:22:24 +0000971Summary:
972 SFX L Y 2 ~
973 SFX L 0 re [^x] ~
974 SFX L 0 ro x ~
975
976The first line is a header and has four fields:
977 SFX {flag} {combine} {count}
978
979{flag} The name used for the suffix. Mostly it's a single letter,
980 but other characters can be used, see |spell-FLAG|.
981
982{combine} Can be 'Y' or 'N'. When 'Y' then the word plus suffix can
983 also have a prefix. When 'N' then a prefix is not allowed.
984
985{count} The number of lines following. If this is wrong you will get
986 an error message.
987
988For PFX the fields are exactly the same.
989
990The basic format for the following lines is:
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000991 SFX {flag} {strip} {add} {condition} {extra}
Bram Moolenaar4770d092006-01-12 23:22:24 +0000992
993{flag} Must be the same as the {flag} used in the first line.
994
995{strip} Characters removed from the basic word. There is no check if
996 the characters are actually there, only the length is used (in
997 bytes). This better match the {condition}, otherwise strange
998 things may happen. If the {strip} length is equal to or
999 longer than the basic word the suffix won't be used.
1000 When {strip} is 0 (zero) then nothing is stripped.
1001
1002{add} Characters added to the basic word, after removing {strip}.
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001003 Optionally there is a '/' followed by flags. The flags apply
1004 to the word plus affix. See |spell-affix-flags|
Bram Moolenaar4770d092006-01-12 23:22:24 +00001005
1006{condition} A simplistic pattern. Only when this matches with a basic
1007 word will the suffix be used for that word. This is normally
1008 for using one suffix letter with different {add} and {strip}
1009 fields for words with different endings.
1010 When {condition} is a . (dot) there is no condition.
1011 The pattern may contain:
1012 - Literal characters.
1013 - A set of characters in []. [abc] matches a, b and c.
1014 A dash is allowed for a range [a-c], but this is
1015 Vim-specific.
1016 - A set of characters that starts with a ^, meaning the
1017 complement of the specified characters. [^abc] matches any
1018 character but a, b and c.
1019
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001020{extra} Optional extra text:
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001021 # comment Comment is ignored
1022 - Hunspell uses this, ignored
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001023
Bram Moolenaar4770d092006-01-12 23:22:24 +00001024For PFX the fields are the same, but the {strip}, {add} and {condition} apply
1025to the start of the word.
1026
1027Note: Myspell ignores any extra text after the relevant info. Vim requires
1028this text to start with a "#" so that mistakes don't go unnoticed. Example:
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +00001029
1030 SFX F 0 in [^i]n # Spion > Spionin ~
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00001031 SFX F 0 nen in # Bauerin > Bauerinnen ~
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +00001032
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +00001033Apparently Myspell allows an affix name to appear more than once. Since this
1034might also be a mistake, Vim checks for an extra "S". The affix files for
1035Myspell that use this feature apparently have this flag. Example:
1036
1037 SFX a Y 1 S ~
1038 SFX a 0 an . ~
1039
1040 SFX a Y 2 S ~
1041 SFX a 0 en . ~
1042 SFX a 0 on . ~
1043
Bram Moolenaar4770d092006-01-12 23:22:24 +00001044
1045AFFIX FLAGS *spell-affix-flags*
1046
1047This is a feature that comes from Hunspell: The affix may specify flags. This
1048works similar to flags specified on a basic word. The flags apply to the
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001049basic word plus the affix (but there are restrictions). Example:
Bram Moolenaar4770d092006-01-12 23:22:24 +00001050
1051 SFX S Y 1 ~
1052 SFX S 0 s . ~
1053
1054 SFX A Y 1 ~
1055 SFX A 0 able/S . ~
1056
1057When the dictionary file contains "drink/AS" then these words are possible:
1058
1059 drink
1060 drinks uses S suffix
1061 drinkable uses A suffix
1062 drinkables uses A suffix and then S suffix
1063
1064Generally the flags of the suffix are added to the flags of the basic word,
1065both are used for the word plus suffix. But the flags of the basic word are
1066only used once for affixes, except that both one prefix and one suffix can be
1067used when both support combining.
1068
1069Specifically, the affix flags can be used for:
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001070- Suffixes on suffixes, as in the example above. This works once, thus you
1071 can have two suffixes on a word (plus one prefix).
Bram Moolenaar4770d092006-01-12 23:22:24 +00001072- Making the word with the affix rare, by using the |spell-RARE| flag.
1073- Exclude the word with the affix from compounding, by using the
1074 |spell-COMPOUNDFORBIDFLAG| flag.
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001075- Allow the word with the affix to be part of a compound word on the side of
1076 the affix with the |spell-COMPOUNDPERMITFLAG|.
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001077- Use the NEEDCOMPOUND flag: word plus affix can only be used as part of a
1078 compound word. |spell-NEEDCOMPOUND|
1079- Compound flags: word plus affix can be part of a compound word at the end,
1080 middle, start, etc. The flags are combined with the flags of the basic
1081 word. |spell-compound|
1082- NEEDAFFIX: another affix is needed to make a valid word.
1083- CIRCUMFIX, as explained just below.
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001084
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001085
1086CIRCUMFIX *spell-CIRCUMFIX*
1087
1088The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
1089If a prefix has the CIRCUMFIX flag than only suffixes with the CIRCUMFIX flag
1090can be added, and the other way around.
1091An alternative is to only specify the suffix, and give the that suffix two
1092flags: The required prefix and the NEEDAFFIX flag. |spell-NEEDAFFIX|
1093
1094
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00001095PFXPOSTPONE *spell-PFXPOSTPONE*
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001096
Bram Moolenaare13305e2005-06-19 22:54:15 +00001097When an affix file has very many prefixes that apply to many words it's not
1098possible to build the whole word list in memory. This applies to Hebrew (a
1099list with all words is over a Gbyte). In that case applying prefixes must be
1100postponed. This makes spell checking slower. It is indicated by this keyword
1101in the .aff file:
1102
1103 PFXPOSTPONE ~
1104
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001105Only prefixes without a chop string and without flags can be postponed.
1106Prefixes with a chop string or with flags will still be included in the word
1107list. An exception if the chop string is one character and equal to the last
1108character of the added string, but in lower case. Thus when the chop string
1109is used to allow the following word to start with an upper case letter.
Bram Moolenaare13305e2005-06-19 22:54:15 +00001110
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001111
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001112WORDS WITH A SLASH *spell-SLASH*
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001113
1114The slash is used in the .dic file to separate the basic word from the affix
Bram Moolenaar33aec762006-01-22 23:30:12 +00001115letters and other flags. Unfortunately, this means you cannot use a slash in
1116a word. Thus "TCP/IP" is not a word but "TCP with the flags "IP". To include
1117a slash in the word put a backslash before it: "TCP\/IP". In the rare case
1118you want to use a backslash inside a word you need to use two backslashes.
1119Any other use of the backslash is reserved for future expansion.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001120
1121
Bram Moolenaar1cbe5f72005-12-29 22:51:09 +00001122KEEP-CASE WORDS *spell-KEEPCASE*
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001123
Bram Moolenaar1cbe5f72005-12-29 22:51:09 +00001124In the affix file a KEEPCASE line can be used to define the affix name used
1125for keep-case words. Example:
Bram Moolenaar45eeb132005-06-06 21:59:07 +00001126
Bram Moolenaar1cbe5f72005-12-29 22:51:09 +00001127 KEEPCASE = ~
Bram Moolenaar45eeb132005-06-06 21:59:07 +00001128
Bram Moolenaar4770d092006-01-12 23:22:24 +00001129This flag is not supported by Myspell. It has the meaning that case matters.
1130This can be used if the word does not have the first letter in upper case at
1131the start of a sentence. Example:
1132
1133 word list matches does not match ~
1134 's morgens/= 's morgens 'S morgens 's Morgens 'S MORGENS
1135 's Morgens 's Morgens 'S MORGENS 'S morgens 's morgens
1136
1137The flag can also be used to avoid that the word matches when it is in all
1138upper-case letters.
Bram Moolenaar45eeb132005-06-06 21:59:07 +00001139
Bram Moolenaare13305e2005-06-19 22:54:15 +00001140
Bram Moolenaar1cbe5f72005-12-29 22:51:09 +00001141RARE WORDS *spell-RARE*
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001142
Bram Moolenaar1cbe5f72005-12-29 22:51:09 +00001143In the affix file a RARE line can be used to define the affix name used for
Bram Moolenaar45eeb132005-06-06 21:59:07 +00001144rare words. Example:
1145
Bram Moolenaar1cbe5f72005-12-29 22:51:09 +00001146 RARE ? ~
Bram Moolenaar45eeb132005-06-06 21:59:07 +00001147
1148Rare words are highlighted differently from bad words. This is to be used for
1149words that are correct for the language, but are hardly ever used and could be
Bram Moolenaar30abd282005-06-22 22:35:10 +00001150a typing mistake anyway. When the same word is found as good it won't be
1151highlighted as rare.
1152
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001153This flag can also be used on an affix, so that a basic word is not rare but
1154the basic word plus affix is rare |spell-affix-flags|. However, if the word
1155also appears as a good word in another way (e.g., in another region) it won't
1156be marked as rare.
1157
Bram Moolenaar30abd282005-06-22 22:35:10 +00001158
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001159BAD WORDS *spell-BAD*
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001160
Bram Moolenaar30abd282005-06-22 22:35:10 +00001161In the affix file a BAD line can be used to define the affix name used for
1162bad words. Example:
1163
1164 BAD ! ~
1165
1166This can be used to exclude words that would otherwise be good. For example
Bram Moolenaar9a50b1b2005-06-27 22:48:21 +00001167"the the" in the .dic file:
1168
1169 the the/! ~
1170
1171Once a word has been marked as bad it won't be undone by encountering the same
1172word as good.
Bram Moolenaar45eeb132005-06-06 21:59:07 +00001173
Bram Moolenaar4770d092006-01-12 23:22:24 +00001174The flag also applies to the word with affixes, thus this can be used to mark
1175a whole bunch of related words as bad.
1176
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001177 *spell-NEEDAFFIX*
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001178The NEEDAFFIX flag is used to require that a word is used with an affix. The
Bram Moolenaar4770d092006-01-12 23:22:24 +00001179word itself is not a good word (unless there is an empty affix). Example:
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001180
1181 NEEDAFFIX + ~
1182
Bram Moolenaar45eeb132005-06-06 21:59:07 +00001183
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001184COMPOUND WORDS *spell-compound*
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001185
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001186A compound word is a longer word made by concatenating words that appear in
1187the .dic file. To specify which words may be concatenated a character is
1188used. This character is put in the list of affixes after the word. We will
1189call this character a flag here. Obviously these flags must be different from
1190any affix IDs used.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001191
1192 *spell-COMPOUNDFLAG*
Bram Moolenaar4770d092006-01-12 23:22:24 +00001193The Myspell compatible method uses one flag, specified with COMPOUNDFLAG. All
1194words with this flag combine in any order. This means there is no control
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001195over which word comes first. Example:
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001196 COMPOUNDFLAG c ~
1197
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001198 *spell-COMPOUNDRULE*
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001199A more advanced method to specify how compound words can be formed uses
1200multiple items with multiple flags. This is not compatible with Myspell 3.0.
1201Let's start with an example:
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001202 COMPOUNDRULE c+ ~
1203 COMPOUNDRULE se ~
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001204
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001205The first line defines that words with the "c" flag can be concatenated in any
1206order. The second line defines compound words that are made of one word with
1207the "s" flag and one word with the "e" flag. With this dictionary:
1208 bork/c ~
1209 onion/s ~
1210 soup/e ~
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001211
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001212You can make these words:
1213 bork
1214 borkbork
1215 borkborkbork
1216 (etc.)
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001217 onion
1218 soup
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001219 onionsoup
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001220
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001221The COMPOUNDRULE item may appear multiple times. The argument is made out of
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001222one or more groups, where each group can be:
1223 one flag e.g., c
1224 alternate flags inside [] e.g., [abc]
1225Optionally this may be followed by:
1226 * the group appears zero or more times, e.g., sm*e
1227 + the group appears one or more times, e.g., c+
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001228
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001229This is similar to the regexp pattern syntax (but not the same!). A few
1230examples with the sequence of word flags they require:
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001231 COMPOUNDRULE x+ x xx xxx etc.
1232 COMPOUNDRULE yz yz
1233 COMPOUNDRULE x+z xz xxz xxxz etc.
1234 COMPOUNDRULE yx+ yx yxx yxxx etc.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001235
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001236 COMPOUNDRULE [abc]z az bz cz
1237 COMPOUNDRULE [abc]+z az aaz abaz bz baz bcbz cz caz cbaz etc.
1238 COMPOUNDRULE a[xyz]+ ax axx axyz ay ayx ayzz az azy azxy etc.
1239 COMPOUNDRULE sm*e se sme smme smmme etc.
1240 COMPOUNDRULE s[xyz]*e se sxe sxye sxyxe sye syze sze szye szyxe etc.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001241
Bram Moolenaara6c840d2005-08-22 22:59:46 +00001242A specific example: Allow a compound to be made of two words and a dash:
1243 In the .aff file:
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001244 COMPOUNDRULE sde ~
Bram Moolenaara6c840d2005-08-22 22:59:46 +00001245 NEEDAFFIX x ~
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001246 COMPOUNDWORDMAX 3 ~
Bram Moolenaara6c840d2005-08-22 22:59:46 +00001247 COMPOUNDMIN 1 ~
1248 In the .dic file:
1249 start/s ~
1250 end/e ~
1251 -/xd ~
1252
1253This allows for the word "start-end", but not "startend".
1254
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001255An additional implied rule is that, without further flags, a word with a
1256prefix cannot be compounded after another word, and a word with a suffix
1257cannot be compounded with a following word. Thus the affix cannot appear
1258on the inside of a compound word. This can be changed with the
1259|spell-COMPOUNDPERMITFLAG|.
1260
Bram Moolenaar4770d092006-01-12 23:22:24 +00001261 *spell-NEEDCOMPOUND*
1262The NEEDCOMPOUND flag is used to require that a word is used as part of a
1263compound word. The word itself is not a good word. Example:
1264
1265 NEEDCOMPOUND & ~
1266
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001267 *spell-COMPOUNDMIN*
Bram Moolenaarac6e65f2005-08-29 22:25:38 +00001268The minimal character length of a word used for compounding is specified with
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001269COMPOUNDMIN. Example:
1270 COMPOUNDMIN 5 ~
1271
Bram Moolenaarac6e65f2005-08-29 22:25:38 +00001272When omitted there is no minimal length. Obviously you could just leave out
1273the compound flag from short words instead, this feature is present for
1274compatibility with Myspell.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001275
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001276 *spell-COMPOUNDWORDMAX*
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001277The maximum number of words that can be concatenated into a compound word is
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001278specified with COMPOUNDWORDMAX. Example:
1279 COMPOUNDWORDMAX 3 ~
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001280
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001281When omitted there is no maximum. It applies to all compound words.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001282
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001283To set a limit for words with specific flags make sure the items in
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001284COMPOUNDRULE where they appear don't allow too many words.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001285
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001286 *spell-COMPOUNDSYLMAX*
1287The maximum number of syllables that a compound word may contain is specified
1288with COMPOUNDSYLMAX. Example:
1289 COMPOUNDSYLMAX 6 ~
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001290
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001291This has no effect if there is no SYLLABLE item. Without COMPOUNDSYLMAX there
1292is no limit on the number of syllables.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001293
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001294If both COMPOUNDWORDMAX and COMPOUNDSYLMAX are defined, a compound word is
Bram Moolenaara6c840d2005-08-22 22:59:46 +00001295accepted if it fits one of the criteria, thus is either made from up to
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001296COMPOUNDWORDMAX words or contains up to COMPOUNDSYLMAX syllables.
Bram Moolenaara6c840d2005-08-22 22:59:46 +00001297
Bram Moolenaar4770d092006-01-12 23:22:24 +00001298 *spell-COMPOUNDFORBIDFLAG*
1299The COMPOUNDFORBIDFLAG specifies a flag that can be used on an affix. It
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001300means that the word plus affix cannot be used in a compound word. Example:
1301 affix file:
1302 COMPOUNDFLAG c ~
1303 COMPOUNDFORBIDFLAG x ~
1304 SFX a Y 2 ~
1305 SFX a 0 s . ~
1306 SFX a 0 ize/x . ~
1307 dictionary:
1308 word/c ~
1309 util/ac ~
1310
1311This allows for "wordutil" and "wordutils" but not "wordutilize".
Bram Moolenaar18144c82006-04-12 21:52:12 +00001312Note: this doesn't work for postponed prefixes yet.
Bram Moolenaar4770d092006-01-12 23:22:24 +00001313
1314 *spell-COMPOUNDPERMITFLAG*
1315The COMPOUNDPERMITFLAG specifies a flag that can be used on an affix. It
1316means that the word plus affix can also be used in a compound word in a way
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001317where the affix ends up halfway the word. Without this flag that is not
1318allowed.
Bram Moolenaar18144c82006-04-12 21:52:12 +00001319Note: this doesn't work for postponed prefixes yet.
Bram Moolenaar4770d092006-01-12 23:22:24 +00001320
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001321 *spell-COMPOUNDROOT*
1322The COMPOUNDROOT flag is used for words in the dictionary that are already a
1323compound. This means it counts for two words when checking the compounding
1324rules. Can also be used for an affix to count the affix as a compounding
1325word.
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001326
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001327 *spell-SYLLABLE*
1328The SYLLABLE item defines characters or character sequences that are used to
1329count the number of syllables in a word. Example:
1330 SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui ~
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001331
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001332Before the first slash is the set of characters that are counted for one
1333syllable, also when repeated and mixed, until the next character that is not
1334in this set. After the slash come sequences of characters that are counted
1335for one syllable. These are preferred over using characters from the set.
1336With the example "ideeen" has three syllables, counted by "i", "ee" and "e".
1337
1338Only case-folded letters need to be included.
1339
Bram Moolenaarc81e5e72007-05-05 18:24:42 +00001340Another way to restrict compounding was mentioned above: Adding the
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001341|spell-COMPOUNDFORBIDFLAG| flag to an affix causes all words that are made
1342with that affix not be be used for compounding.
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001343
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001344
1345UNLIMITED COMPOUNDING *spell-NOBREAK*
1346
1347For some languages, such as Thai, there is no space in between words. This
1348looks like all words are compounded. To specify this use the NOBREAK item in
1349the affix file, without arguments:
1350 NOBREAK ~
1351
1352Vim will try to figure out where one word ends and a next starts. When there
1353are spelling mistakes this may not be quite right.
1354
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001355
Bram Moolenaar4770d092006-01-12 23:22:24 +00001356 *spell-COMMON*
1357Common words can be specified with the COMMON item. This will give better
1358suggestions when editing a short file. Example:
1359
1360 COMMON the of to and a in is it you that he was for on are ~
1361
1362The words must be separated by white space, up to 25 per line.
1363When multiple regions are specified in a ":mkspell" command the common words
1364for all regions are combined and used for all regions.
1365
1366 *spell-NOSPLITSUGS*
Bram Moolenaarfd2ac762006-03-01 22:09:21 +00001367This item indicates that splitting a word to make suggestions is not a good
1368idea. Split-word suggestions will appear only when there are few similar
1369words.
Bram Moolenaar4770d092006-01-12 23:22:24 +00001370
1371 NOSPLITSUGS ~
1372
1373 *spell-NOSUGGEST*
1374The flag specified with NOSUGGEST can be used for words that will not be
1375suggested. Can be used for obscene words.
1376
1377 NOSUGGEST % ~
1378
Bram Moolenaar4770d092006-01-12 23:22:24 +00001379
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001380REPLACEMENTS *spell-REP*
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001381
1382In the affix file REP items can be used to define common mistakes. This is
1383used to make spelling suggestions. The items define the "from" text and the
1384"to" replacement. Example:
1385
1386 REP 4 ~
1387 REP f ph ~
1388 REP ph f ~
1389 REP k ch ~
1390 REP ch k ~
1391
Bram Moolenaar6e7c7f32005-08-24 22:16:11 +00001392The first line specifies the number of REP lines following. Vim ignores the
Bram Moolenaar4770d092006-01-12 23:22:24 +00001393number, but it must be there (for compatibility with Myspell).
Bram Moolenaar6e7c7f32005-08-24 22:16:11 +00001394
Bram Moolenaard042c562005-06-30 22:04:15 +00001395Don't include simple one-character replacements or swaps. Vim will try these
1396anyway. You can include whole words if you want to, but you might want to use
1397the "file:" item in 'spellsuggest' instead.
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001398
Bram Moolenaar1e015462005-09-25 22:16:38 +00001399You can include a space by using an underscore:
1400
1401 REP the_the the ~
1402
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001403
Bram Moolenaara40ceaf2006-01-13 22:35:40 +00001404SIMILAR CHARACTERS *spell-MAP* *E783*
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001405
Bram Moolenaard042c562005-06-30 22:04:15 +00001406In the affix file MAP items can be used to define letters that are very much
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001407alike. This is mostly used for a letter with different accents. This is used
1408to prefer suggestions with these letters substituted. Example:
1409
1410 MAP 2 ~
1411 MAP eéëêè ~
1412 MAP uüùúû ~
1413
Bram Moolenaar6e7c7f32005-08-24 22:16:11 +00001414The first line specifies the number of MAP lines following. Vim ignores the
1415number, but the line must be there.
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001416
Bram Moolenaard042c562005-06-30 22:04:15 +00001417Each letter must appear in only one of the MAP items. It's a bit more
1418efficient if the first letter is ASCII or at least one without accents.
Bram Moolenaare7566042005-06-17 22:00:15 +00001419
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001420
Bram Moolenaar4770d092006-01-12 23:22:24 +00001421.SUG FILE *spell-NOSUGFILE*
1422
1423When soundfolding is specified in the affix file then ":mkspell" will normally
Bram Moolenaard12f5c12006-01-25 22:10:52 +00001424produce a .sug file next to the .spl file. This file is used to find
1425suggestions by their sound-a-like form quickly. At the cost of a lot of
1426memory (the amount depends on the number of words, |:mkspell| will display an
1427estimate when it's done).
Bram Moolenaar4770d092006-01-12 23:22:24 +00001428
1429To avoid producing a .sug file use this item in the affix file:
1430
1431 NOSUGFILE ~
1432
Bram Moolenaard12f5c12006-01-25 22:10:52 +00001433Users can simply omit the .sug file if they don't want to use it.
1434
Bram Moolenaar4770d092006-01-12 23:22:24 +00001435
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001436SOUND-A-LIKE *spell-SAL*
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001437
1438In the affix file SAL items can be used to define the sounds-a-like mechanism
1439to be used. The main items define the "from" text and the "to" replacement.
Bram Moolenaard042c562005-06-30 22:04:15 +00001440Simplistic example:
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001441
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00001442 SAL CIA X ~
1443 SAL CH X ~
1444 SAL C K ~
1445 SAL K K ~
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001446
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001447There are a few rules and this can become quite complicated. An explanation
Bram Moolenaard042c562005-06-30 22:04:15 +00001448how it works can be found in the Aspell manual:
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001449http://aspell.net/man-html/Phonetic-Code.html.
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +00001450
1451There are a few special items:
1452
1453 SAL followup true ~
1454 SAL collapse_result true ~
1455 SAL remove_accents true ~
1456
1457"1" has the same meaning as "true". Any other value means "false".
1458
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001459
Bram Moolenaar6f16eb82005-08-23 21:02:42 +00001460SIMPLE SOUNDFOLDING *spell-SOFOFROM* *spell-SOFOTO*
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001461
1462The SAL mechanism is complex and slow. A simpler mechanism is mapping all
1463characters to another character, mapping similar sounding characters to the
1464same character. At the same time this does case folding. You can not have
Bram Moolenaard042c562005-06-30 22:04:15 +00001465both SAL items and simple soundfolding.
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001466
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001467There are two items required: one to specify the characters that are mapped
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001468and one that specifies the characters they are mapped to. They must have
1469exactly the same number of characters. Example:
1470
1471 SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ~
1472 SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkes ~
1473
1474In the example all vowels are mapped to the same character 'e'. Another
Bram Moolenaard042c562005-06-30 22:04:15 +00001475method would be to leave out all vowels. Some characters that sound nearly
1476the same and are often mixed up, such as 'm' and 'n', are mapped to the same
1477character. Don't do this too much, all words will start looking alike.
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001478
1479Characters that do not appear in SOFOFROM will be left out, except that all
1480white space is replaced by one space. Sequences of the same character in
1481SOFOFROM are replaced by one.
1482
1483You can use the |soundfold()| function to try out the results. Or set the
Bram Moolenaarcc016f52005-12-10 20:23:46 +00001484'verbose' option to see the score in the output of the |z=| command.
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001485
1486
Bram Moolenaar4770d092006-01-12 23:22:24 +00001487UNSUPPORTED ITEMS *spell-affix-not-supported*
1488
1489These items appear in the affix file of other spell checkers. In Vim they are
1490ignored, not supported or defined in another way.
1491
1492ACCENT (Hunspell) *spell-ACCENT*
1493 Use MAP instead. |spell-MAP|
1494
1495CHECKCOMPOUNDCASE (Hunspell) *spell-CHECKCOMPOUNDCASE*
1496 Disallow uppercase letters at compound word boundaries.
1497 Not supported.
1498
1499CHECKCOMPOUNDDUP (Hunspell) *spell-CHECKCOMPOUNDDUP*
1500 Disallow using the same word twice in a compound. Not
1501 supported.
1502
1503CHECKCOMPOUNDREP (Hunspell) *spell-CHECKCOMPOUNDREP*
1504 Something about using REP items and compound words. Not
1505 supported.
1506
1507CHECKCOMPOUNDTRIPLE (Hunspell) *spell-CHECKCOMPOUNDTRIPLE*
1508 Forbid three identical characters when compounding. Not
1509 supported.
1510
1511CHECKCOMPOUNDPATTERN (Hunspell) *spell-CHECKCOMPOUNDPATTERN*
1512 Forbid compounding when patterns match. Not supported.
1513
Bram Moolenaar4770d092006-01-12 23:22:24 +00001514COMPLEXPREFIXES (Hunspell) *spell-COMPLEXPREFIXES*
1515 Enables using two prefixes. Not supported.
1516
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001517COMPOUND (Hunspell) *spell-COMPOUND*
Bram Moolenaarc81e5e72007-05-05 18:24:42 +00001518 This is one line with the count of COMPOUND items, followed by
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00001519 that many COMPOUND lines with a pattern.
1520 Remove the first line with the count and rename the other
1521 items to COMPOUNDRULE |spell-COMPOUNDRULE|
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001522
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001523COMPOUNDFIRST (Hunspell) *spell-COMPOUNDFIRST*
1524 Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
1525
Bram Moolenaar4770d092006-01-12 23:22:24 +00001526COMPOUNDBEGIN (Hunspell) *spell-COMPOUNDBEGIN*
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001527 Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
Bram Moolenaar4770d092006-01-12 23:22:24 +00001528
1529COMPOUNDEND (Hunspell) *spell-COMPOUNDEND*
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001530 Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
Bram Moolenaar4770d092006-01-12 23:22:24 +00001531
1532COMPOUNDMIDDLE (Hunspell) *spell-COMPOUNDMIDDLE*
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001533 Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
Bram Moolenaar4770d092006-01-12 23:22:24 +00001534
Bram Moolenaar4770d092006-01-12 23:22:24 +00001535COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE*
1536 Use SYLLABLE and COMPOUNDSYLMAX instead. |spell-SYLLABLE|
1537 |spell-COMPOUNDSYLMAX|
1538
Bram Moolenaar4770d092006-01-12 23:22:24 +00001539FORBIDDENWORD (Hunspell) *spell-FORBIDDENWORD*
1540 Use BAD instead. |spell-BAD|
1541
Bram Moolenaar4770d092006-01-12 23:22:24 +00001542LANG (Hunspell) *spell-LANG*
1543 This specifies language-specific behavior. This actually
1544 moves part of the language knowledge into the program,
1545 therefore Vim does not support it. Each language property
1546 must be specified separately.
1547
1548LEMMA_PRESENT (Hunspell) *spell-LEMMA_PRESENT*
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001549 Only needed for morphological analysis.
Bram Moolenaar4770d092006-01-12 23:22:24 +00001550
1551MAXNGRAMSUGS (Hunspell) *spell-MAXNGRAMSUGS*
1552 Not supported.
1553
Bram Moolenaar4770d092006-01-12 23:22:24 +00001554ONLYINCOMPOUND (Hunspell) *spell-ONLYINCOMPOUND*
1555 Use NEEDCOMPOUND instead. |spell-NEEDCOMPOUND|
1556
1557PSEUDOROOT (Hunspell) *spell-PSEUDOROOT*
1558 Use NEEDAFFIX instead. |spell-NEEDAFFIX|
1559
1560SUGSWITHDOTS (Hunspell) *spell-SUGSWITHDOTS*
1561 Adds dots to suggestions. Vim doesn't need this.
1562
1563SYLLABLENUM (Hunspell) *spell-SYLLABLENUM*
1564 Not supported.
1565
1566TRY (Myspell, Hunspell, others) *spell-TRY*
1567 Vim does not use the TRY item, it is ignored. For making
Bram Moolenaara94bc432006-03-10 21:42:59 +00001568 suggestions the actual characters in the words are used, that
1569 is much more efficient.
Bram Moolenaar4770d092006-01-12 23:22:24 +00001570
Bram Moolenaar4770d092006-01-12 23:22:24 +00001571WORDCHARS (Hunspell) *spell-WORDCHARS*
1572 Used to recognize words. Vim doesn't need it, because there
1573 is no need to separate words before checking them (using a
1574 trie instead of a hashtable).
1575
Bram Moolenaar217ad922005-03-20 22:37:15 +00001576 vim:tw=78:sw=4:ts=8:ft=help:norl: