7

I'm starting using vim's spell check function today. But seems it treat Chinese characters as wrong spell word.

Thus I did a little research, and find I should use set spelllang=X option.

But the thing is, I don't know what's the vim abbreviation for Chinese here. I tried zh and cn, both failed.

I did some searching on google, no result, either.

Does someone know in which file, web-page or help command resides this abbreviation reference list for all languages in spelllang option?

2
  • 2
    I see a list of dictionaries available under vim here: ftp.vim.org/vim/runtime/spell but I don't see Chinese listed among them.
    – John1024
    Commented Mar 27, 2015 at 5:03
  • @John1024, that's quite valuable, is there possible to make vim ignore all utf-8 code instead of treating them as wrong spelling word?
    – ZengJuchen
    Commented Mar 27, 2015 at 6:58

1 Answer 1

12

The built-in spellfile.vim script will attempt to download missing spell files from http://ftp.vim.org/vim/runtime/spell.

In general, spell checking is not supported for East Asian languages like Chinese and Japanese, because individual words are not separated by whitespace, so a different algorithm would be needed.

You probably want to

:set spelllang+=cjk

to avoid highlighting those. From :help 'spelllang':

If the name "cjk" is included East Asian characters are excluded from spell checking. This is useful when editing text that also has Asian words.

3
  • It's you again, life saver!
    – ZengJuchen
    Commented Mar 27, 2015 at 7:38
  • Good! +1 (it makes sense: in cjk the notion of individual word with errors is not so clear...)
    – JJoao
    Commented Mar 27, 2015 at 7:44
  • This feature seems to be pretty recent: not in 7.4.52 (Ubuntu 14.04), but in the source tree as you say. Commented May 10, 2015 at 5:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .