3

I enjoy spelling Latin and Greek loan words according to their original spelling, e.g. præcise and œconomy. Might there be a convenient way to add these to the spellfile (manually) and at the same time mark their modern counterparts as bad (i.e. the words that in each case have e for æ and œ)?

Perhaps the very best solution would be a script that looked up all words containing æ or œ, and, if the same word with e were considered correct, would accept the variant and mark the original as bad (and otherwise do nothing).

Toothrot
  • 3,129
  • 13
  • 27

1 Answers1

2

The solution to this is similar to How can I use Vim's spellcheck with ‘smart quotes’ and Can the spell checker be told to stop marking words with apostrophes as bad?

You can add your variants to ~/.vim/spell/en.utf-8.add, and mark the undesired as wrong by adding /!:

œconomy
economy/!

Then compile it with :mkspell:

:!mkspell %

And you should be good to go.

You can do this from normal more with zg (mark good) and zw (mark wrong). You don't need to use :mkspell with this.

To do this automatically for all words is a bit more difficult. The æ in præcise or æther is an e, but the æ in encyclopædia or archæology is an ae... How do you know which one to use?

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
  • I'm thinking of making a mapping zæ that checks if the word under the cursor with e for æ is good; if it is not good, nothing happens; if it is good, it is marked as bad, and the word with æ is marked as good. Not quite sure how to do it yet though, but I imagine it should be fairly easy. – Toothrot Mar 03 '16 at 12:29
  • @Lawrence Not sure if mapping æ will work if I understand the comments here correctly... – Martin Tournoij Mar 03 '16 at 12:33
  • I already did it with a temporary solution: nmap zæ yawPfærezwdawbzg. Maybe it is only an issue with ctrl. – Toothrot Mar 03 '16 at 12:34