preservim / vim-textobj-quote

Use ‘curly’ quote characters in Vim
Other
123 stars 6 forks source link

Instructions for getting vim to recognize ’ in spell check #10

Closed zeorin closed 2 years ago

zeorin commented 8 years ago

Hi, I've noticed that Vim's native spell check doesn't recognize the in words. This sucks.

I've researched several approaches for getting it to recognize it: some included using plugins to use different spell check engines. I thought that was overkill.

So, it turns out there's a better way, create a custom spelling file with the correct entries and get Vim to use it:

  1. Open Vim, with spell check enabled
  2. Run :spelldump. Remove any comment lines (lines starting with #)
  3. Save this file somewhere, e.g. ~/spelldump.txt
  4. Replace all the ' characters with characters, e.g. by running grep "'" ~/spelldump.txt | sed "s/'/’/g" >> ~/spelldump_smartquotes.txt
  5. Place this file in a location Vim expects, like ~/.vim/spell/en.utf-8.add or ~/.config/nvim/spell/en.utf-8.add (NeoVim). If that file already exists, append to it instead of overwriting it, but the first line (the region line) ought to be at the top of the file, instead of appended at the bottom. If there's already a region line at the top and it's different to the one in the new file, consult the Vim spelling docs to understand the spell format and make the appropriate changes.
  6. Start Vim, run :mkspell! ~/.vim/spell/en.utf-8.add
  7. Restart Vim

Now Vim should recognize the closing single quote mark in words. Phew.

Perhaps you'd like to add this to the docs.

reedes commented 8 years ago

Good idea. I'll keep this open as an enhancement for the README.

telemachus commented 4 years ago

There is a better way to do this, I think.

https://vi.stackexchange.com/a/172/7933

(This is a note to myself to add this while working on #6.)

telemachus commented 2 years ago

Closing since the documentation now includes a version of this advice.