I want to change the characters, spell checking considers to being separating words.

I already have the following line in my ~/.vimrc file, which makes w and b recognize words with a - in between as one word:

 autocmd BufEnter,BufNewFile,TabEnter *.md set iskeyword=38,42,43,45,47-57,60-62,_,@

According to ASCII the 45 is the - character. However, spell checking seems to use another list of characters. When I write something like:


I want it to be considered one word only, so that I may add this word to my word list as a correct word, instead of one of the parts abc or def being marked as a spelling mistake.

Is this possible? If it is, how?

1 Answer 1


Looks like you can't do this, see :h spell.txt (emphasis mine):


Vim uses a fixed method to recognize a word. This is independent of 'iskeyword', so that it also works in help files and for languages that include characters like '-' in 'iskeyword'. The word characters do depend on 'encoding'.

  • 2
    Seems you're right, the second paragraph is also important: > The table with word characters is stored in the main .spl file. Therefore it matters what the current locale is when generating it! A .add.spl file does not contain a word table though. So one cannot change it in a self created extra file either it seems. I guess I could change the original German spl file. Commented Nov 2, 2016 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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