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

推荐订阅源

博客园 - Franky
D
Docker
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
爱范儿
爱范儿
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
Recent Announcements
Recent Announcements
U
Unit 42
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
量子位
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog

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#