aboutsummaryrefslogtreecommitdiff
path: root/doc/html_spelllang.txt
blob: 1ea93c0a0fd0a6681997cbe2ba67ab77fb98c248 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
*html_spelllang.txt*	For Vim version 8.2	Last change: 2022 May 9

DESCRIPTION					*html_spelllang*

This filetype plugin for HTML searches for `<html>`, `<body>`, and `<main>`
elements, and attempts to set the 'spelllang' option appropriately if it
detects that spelling files exist corresponding to any `lang=` attribute
defined for the lattermost instances of these elements within the first 128
lines.

This includes switching on common RFC 4646 language region codes; for example,
an `en-us` attribute may attempt to set 'spelllang' to `en_US`.  Only simple
`LANGUAGE-REGION` codes are presently supported; there's quite a lot more to
the relevant RFC.

It also includes a hook to re-check the same number of lines if the buffer is
modified, in case the language code has been updated.  Where supported, this
is done with the |TextChanged| autocommand event.

REQUIREMENTS					*html_spelllang-requirements*

This plugin is only available if 'compatible' is not set.  It presently
requires Vim 8.2 or newer, but can almost certainly be back-ported.

OPTIONS						*html_spelllang-options*

You probably don't actually want to change these, but just in case:

						*g:html_spelllang_lines*
Set `g:html_spelllang_lines` in your |vimrc| to a number besides 128 if you
want to change the number of lines to be checked for language codes in the
buffer, both on initial load and buffer modification.

						*g:html_spelllang_pattern*
Set `g:html_spelllang_pattern` in your |vimrc| if you really want to override
the pattern used to match the language code.  You will want two matching
subgroups for |matchlist()|: one for the language, and a second for for the
optional region.

AUTHOR						*html_spelllang-author*

Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.

LICENSE						*html_spelllang-license*

Licensed for distribution under the same terms as Vim itself (see |license|).

 vim:tw=78:ts=8:ft=help:norl: