In Swedish, you make compound words by just adding words together right after each other without a space in between as in English. You can make almost any combination, e.g. "staff matters" is "personal" (staff) and "ärenden" (matters) added together like "personalärenden". The vim spell check marks compound words like this as wrong. How can I make vim recognize words as correct if they consist of several correct words?

EDIT: I researched it a bit more. Whether or not a word can be part of a compound word or not is decided in the dictionary files (the .dic and .aff) with some kind of flags. The .spl file that vim downloaded for Swedish apparently wasn't based on .dic and .aff files with these flags.

LibreOffice has no problem with the compound words so I tried downloading the Swedish dictionary from their extensions website. I then created a .spl file that vim can use with

:mkspell sv sv_SE

and put the resulting sv.utf-8.spl in ~/.vim/spell.

Even though LibreOffice and vim now use the same dictionary, vim marks words as wrong even when LibreOffice accepts them.

  • Worked like a charm! Thanks!
    – Daghall
    Jan 25 at 13:15

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.