Spellcheck only for English in vim
I must admit vim is a very powerful text editor, but it still makes me
feel ancient (well, emacs is even more ancient for me). I have to tweak
my .vimrc a thousands times to make it work well with me.
I can't think of any case that we would want to do spell check
on CJK characters for English words or grammar... It just didn't
make sense.
After googling a bit, finally I found the solution.
Something like this should be the default.
syntax match English /[!-~]/ contains=@spell syntax match Normal /[^!-~]/ contains=@nospell
What surprised me was that, someone didn't think mixing languages
in a text is usual. Well, I am always mixing Chinese and English.
It's hardly to find me writing only in Chinese....
I know something like *WWW* is not really English, but is it Chinese?
Mixing languages are so often.. and other than vim, I didn't see
which text editor would also mark all Chinese as wrong spelling.
That would be insane for non-English writers...
2 retries:
Thank you.
It looks a good idea to set the environment of vim.
The following is my setting for LaTeX file.
augroup filetype
au! BufRead,BufNewFile *.tex set spell
augroup END
I only spell check for tex file. I have no requirement for other file format.
Maybe there are other way to set the vim. XD
I would like to see spellcheck for source codes with comments :p
So actually I need to change the color for bad spelling too,
otherwise it would be too noisy.
And thanks for the info. It seems I might want to set some group as well.
Post a Comment
Note: Only a member of this blog may post a comment.