I know that I can set the spell checking language to a different language e.g. using the command:
:set spelllang=de
I don't want to execute this command every time I open a different file. I remember that there was some syntax to embed vim commands or settings per file by adding a line to the top of the file. I've tried all kind of search strings on stackoverflow, checked the suggested similar questions, and on the rest of the web but cant find this. (Maybe I'm also wrong with this.)
How do I set the spell checking language on a file level in vim.
This is called modeline. To set the spell checking language put the following line at the top of your document
% vim: spelllang=de
Don't forget to enable modeline: Why does Vim ignore my modeline values?