from vim user group
++++++++++++++++++++++++++++++++++++++++++++++++++++++
I have a long list of words, on word per line. Many of the words are
not "words", i.e. not in a dictionary.
I would like to turn on vim's spell check and delete only the words
vim knows. Then I will go thru the remaining words and add them, or
not, to my vim word list.
Is that possible?
:%s//w/+//=printf("%s", empty(spellbadword(submatch(0))[0])?submatch(0):'')/
++++++++++++++++++++++++++++++++++++++++++++++++++++++
本文介绍如何使用Vim批量删除文档中已知的单词,并保留未知单词以进行后续处理。通过设置Vim的拼写检查功能并利用正则表达式,可以高效地筛选出需要关注的词汇。

被折叠的 条评论
为什么被折叠?



