Search code examples
vimspell-checkingvim-syntax-highlighting

How to make vim SpellCheck *not* code aware?


By default, vim spell checker is code aware, so it doesn't spell-check code parts of the file. In effect, in markdown it considers (pandoc multiline) tables to be codes and thus doesn't spell-check their contents.

Is it possible to override this? Or enable spell-check for the entire file including code.


Solution

  • As far as I'm able to determine, there is no way to tell Vim to ignore the spellcheck suggestions in the syntax file and to just "check everything".

    A fairly heavy-handed workaround is to disable syntax entirely with :syn off; you can re-enable this with :syn on.

    Specifically for Markdown, you can disable highlighting of code blocks with :syn clear markdownCodeBlock; you can reset this with :syn on as well.