Jiang Qian wrote:
Hi all:
I love the new spell check features. I usually write in English, which is why I set my spellchecker to en-us. However I sometimes write in Chinese, which AFAIK has no vim spell checker. So every time I write something it will underline it. Of course I can manually write
:set nospell
to disable spellchecker every time I write in Chinese, but is there an more intelligent way by which vim somehow know part of the paragraph is written in Chinese and skip them? I recall spellchecker plugin I used before doesn't seem to be bothered by my writing some Chinese.
Thanks a lot in advance.
Jiang


The 'spell' option is local-to-window. You can set it (for any file, but not just part of it) by means of a modeline (q.v.), for example

<HTML><HEAD>
<!-- vim: set nospell :-->

at the top of an HTML file, or

--
Best regards,
Jiang Qian
-----
vim:nospell

at the bottom of an email. As the latter example shows, there may be a problem if the filetype doesn't allow "comments" and you don't want the modeline to be seen. (In an email, you could create a custom header, but not all mail clients allow it.)


The EncodingChanged event cannot be used IIUC, since it applies to the global 'encoding' option, not to the local 'fileencoding'. Anyway, UTF-8 can be used for both English and Chinese, so in this case I don't recommend using the charset as a criterion.


If you have a file in _mixed_ language (part of the file in English and another part in Chinese), then I don't know if (or how) Vim can spell-check only the "English" paragraphs. It might be as simple as excluding anything in the "Chinese" part of the Unicode range from spell-checking altogether.


Best regards,
Tony.

Reply via email to