I haven't found a way to disable spell checking for single character "words", like when you type 100k (k as in thousand) and it gets highlighted as a mistake. I already tried this:

syn match SingleChar '/\<\S\>' contains=@NoSpell

But it doesn't do a thing.

I know I could add all characters in a spell file but that seems a bit cheap and would require me to move my spell file around with me instead of just the vimrc.

Thanks in advance!

  • Your problem is that \S matches characters in "100" also. Try /\<\A*\a\A*\> instead. (I'm not posting this as an answer since I haven't gotten around to testing it yet) – James Aug 16 '16 at 23:42
  • Hmm, I tried answering this, but for some reason 100k does not show up as a mistake for me, even when I do vim -u NONE. What version of vim are you using? – James Aug 17 '16 at 19:37
  • I'm running 7.4.0 I get the same result as OP. I used @DJMcMayhem suggestion :syn match SingleChar '\<\A*\a\A*\>' contains=@NoSpell and that worked for me. – Tumbler41 Aug 19 '16 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.