VIM 拼写/spell check
VIM 拼写检查/spell check
一、Hunspell科普
Hunspell 作为一个拼写检查的工具,已经用在了许多开源的以及商业软件中。包括Google Chrome, Libreoffice等。
二、Vimspell使用
Use :set spell
to turn on spell-checking. If it's source code, gvim is smart enough to only spellcheck comments and string literals.
:help spell
will give you all the details. Here are some excerpts:
To search for the next misspelled word: ]s
Move to next misspelled word after the cursor. A count before the command can be used to repeat. 'wrapscan' applies.
[s
Like "]s" but search backwards, find the misspelled word before the cursor.
Finding suggestions for bad words: z=
For the word under/after the cursor, suggest correctly spelled words.
To add words to your own word list: zg
Add word under the cursor as a good word
默认情况下,VIM只安装了English的语法检查的相应脚本en.xx.spl
(xx是编码格式)。位置在C:\Program Files\Vim\vim74\spell
。如果要做French,Chinese,Deutsech,Japanese的语法检查,要下载相应的语法规则文件,这里需要安装一个工具cURL
三、设置vimrc
在vimrc
中添加几行
set spelllangs=en,fr,de,ch,jp
set spell
参考:
1、curl
2、Hunspell --> Hunguarian Spell
3、VIM spell check