If I set spell, Vim seems to only recognise some ordinal numbers: 1st, 2nd, etc. are fine, but anything from 10th to 20th is apparently misspelled. Then 21st, 22nd and 23rd are fine, but then they're all misspellings until 31st...

image as described above

I'm using Vim 8.1.290.

Why is Vim so inconsistent here, and how can I fix it (ideally without adding th to my spellfile)?

  • 1
    I don't think 21-23, 31-33 are actually considered correct spellings. Put "st", "nd" or "rd" after any number and it's no longer flagged. Probably 1 through 9 are in the dictionary and that's it. Did you try adding any of the others to the dictionary? – B Layer Oct 7 at 8:07
  • 31st (for instance) actually is correct though. You say "thirty-first" not "thirty-oneth". – DopeGhoti Oct 10 at 22:39
  • @DopeGhoti You mean all this time that I've been saying "thirty-oneth" and "twenty-three'nd" I've been wrong? :P What I actually meant was that Vim doesn't consider them correct (or incorrect) spellings...31st and 31nd are treated equally. – B Layer Nov 2 at 7:45

This is an aspell problem; not a vim problem. aspell itself has these deficiencies. You need simply to add the missing ordinal numbers to the dictionary.

$ echo "1st 21st 31st 5th 25th 35th" | aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.7-20110707)
*
*
*
& th 50 15: Th, Thu, the, tho, thy, THC, Rh, HT, ht, H, T, h, t, nth, Ch, OH, TA, Ta, Te, Ti, Tu, Ty, ah, ch, eh, oh, pH, sh, ta, ti, to, uh, DH, NH, TB, TD, TM, TN, TV, TX, Tb, Tc, Tl, Tm, tb, tn, tr, ts, Th's, T's
& th 50 20: Th, Thu, the, tho, thy, THC, Rh, HT, ht, H, T, h, t, nth, Ch, OH, TA, Ta, Te, Ti, Tu, Ty, ah, ch, eh, oh, pH, sh, ta, ti, to, uh, DH, NH, TB, TD, TM, TN, TV, TX, Tb, Tc, Tl, Tm, tb, tn, tr, ts, Th's, T's
& th 50 25: Th, Thu, the, tho, thy, THC, Rh, HT, ht, H, T, h, t, nth, Ch, OH, TA, Ta, Te, Ti, Tu, Ty, ah, ch, eh, oh, pH, sh, ta, ti, to, uh, DH, NH, TB, TD, TM, TN, TV, TX, Tb, Tc, Tl, Tm, tb, tn, tr, ts, Th's, T's

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.