如何在 gVim 中进行拼写检查? [英] How can I spellcheck in gVim?

查看:27
本文介绍了如何在 gVim 中进行拼写检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 gVim 中进行拼写检查的最佳方法是什么?有没有加成什么的?我也希望它提供更正.

What is the best way to spellcheck in gVim? Is there an add-on or something? I would like it to offer corrections as well.

推荐答案

使用 :set spell 打开拼写检查.如果是源代码,gvim 足够聪明,只对注释和字符串文字进行拼写检查.

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 会给你所有的细节.以下是部分摘录:

: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

另见:help set spelllang 有关更改词典以包含其他地区、语言或词组(例如医学术语)的信息.

Also see :help set spelllang for information on changing your dictionary to include other regions, languages, or word sets (for example, medical jargon).

gvim 必须用 |+syntax| 编译.

gvim must be compiled with |+syntax|.

我没有将 :set spell 放在我的 .vimrc 中,因为当我编码时,我的注释中有太多变量名被标记了.如果您想检查某种文件类型,请在 .vimrc 中使用自动命令.或者在需要时手动打开它.

I don't put :set spell in my .vimrc because when I'm coding there are just too many variable names in my comments that get flagged. If there is a certain file type you want checked use an autocommand in your .vimrc. Or just turn it on manually when you need it.

这篇关于如何在 gVim 中进行拼写检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆