$ grep "'" /usr/share/dict/words | wc -l
$ grep -i python /usr/share/dict/words
The problem is that all these words with apostrophes are actually in your dictionary file.
So if you're okay with modifying your vim spelling dictionary, then do so:
$ grep "'" /usr/share/dict/words | sed "s/'/’/g" >> ~/.vim/spell/en.utf-8.add
grep to find all words in your system dictionary that contain an apostrophe (
sed to change the straight quotes to smart quotes (that's
s/'/’/g, where the first quote is straight and the second is smart); and
- append it to your language dictionary (replace with whatever your language is).
You will need to recompile this to a
.spl file, which you can do from Vim:
If you want to use the actual spell files that Vim uses as a starting place (instead of your system dictionary), you can use the
The output will include all the words Vim uses for the current
spelllang, including those already added from the
Save the result of
:spelldump to a file and remove the first two lines (header info), then use the same commands as above.
You may also want to pipe it through
uniq as well, to remove duplicate entries.
(No need to
sort; the output of
:spelldump is already sorted.)