I have book length prose content in Markdown files that is mostly in Turkish. I've done a lot of work to get Turkish spell checking working decently in vim, so :set spelllang=tr spell
works well enough. However my prose contains lots of excerpts in other languages (English, Greek, Hebrew, German, Latin, French, etc.). These are tagged with some inline markup (and later typeset with correct language handling by Pandoc with some inline extensions similar to the ones allowing inline LaTeX but modified to work with SILE. This markup looks something like this:
... adına başka bir şey de deseydik gül (\lang:en{a rose by any other name}) ...
These have predictable tags such as en
, el
, he
, de
, la
, fr
, etc. that correspond to ISO-639-2 language codes, the same as vim would need to be told to spellcheck these languages.
Finally I have some words that are transliterations or deliberately gibberish that are tagged \lang:und{}
.
My question is would it be possible to ask VIM to spellcheck these regions based on the syntax? Right now I am manually skipping over them. I realize I can probably setup a syntax highlighter to ignore the regions altogether, but can vim spellcheck different regions as different languages?