惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Jina AI
Jina AI
GbyAI
GbyAI
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
P
Proofpoint News Feed
The Cloudflare Blog
H
Help Net Security
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
量子位
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
月光博客
月光博客

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Spell Checking in Nvim
2019-04-29 · via jdhao's digital space
Update log
  • 2021-10-17: add spellsuggest option.

In this post, I want to talk about how to enable the built-in spell checking feature in Nvim.

Enable spell check#

First we need to add spell checking languages:

" spell languages
set spelllang=en,cjk

In the above config, we set spell languages to en and cjk. Item cjk is used to prevent CJK characters from being marked as spell errors. This is also documented in the Nvim doc:

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.

Another option to tweak is spellsuggest, I use the following settings:

" Show nine spell checking candidates at most
set spellsuggest=best,9

To enable spell checking, run command :set spell. I have set up two mappings to toggle spell checking:

nnoremap <silent> <F11> :set spell!<cr>
inoremap <silent> <F11> <C-O>:set spell!<cr>

We can then press F11 to toggle spell checking.

Correct spell errors#

In insert mode, if you have typed a word which Vim thinks is miss-spelled, an underline is shown below. To correct this error, press <C-x> followed by s. A completion menu will show a list of suggestions. You can then choose the correct one.

In normal mode, to navigate between possible spell errors, use the following shortcut:

  • [s: go to previous spell error
  • ]s: go to next spell error

The built-in spell checker is not perfect and can create false positives easily. If you think a word is not a spell error, you can use zg to add it to your spell file. To correct an error, press z=. A list of candidate words will be shown. You are prompted to enter a number to select the correct one. Or you may use 1z= to choose the first candidate directly.

References#