For example, HTML partial templates are being flagged with tons of errors but they are supposed to be fragments of a complete HTML doc.
-
Try `:help syntastic-quickstart` and `:help 'syntastic_mode_map'`. – Sato Katsura Aug 05 '15 at 03:40
3 Answers
In your .vimrc
:
let g:syntastic_mode_map = {
\ "mode": "active",
\ "passive_filetypes": ["go"] }
This sets Syntastic to active mode (checks are made on save or open) but not for, in this case, Go files, which will be checked only when explicitly running :SyntasticCheck
. Just change the array of passive_filetypes
to whatever you need.

- 554
- 4
- 15
-
Is this the correct way to specify the array? `"passive_filetypes": ["go", "html"]` ? – Eno Aug 06 '15 at 17:39
In .vimrc
to ignore .env
file for example:
let g:syntastic_ignore_files = ['.env']
From the :help syntastic
:
Use this option to specify files that syntastic should never check. It's a list of |regular-expression| patterns. The full paths of files (see |::p|) are matched against these patterns, and the matches are case-sensitive. Use |\c| to specify case-insensitive patterns. Example:
let g:syntastic_ignore_files = ['\m^/usr/include/', '\m\c\.h$']
There's also another one, syntastic_<filetype>_<checker>_quiet_messages
:
Finally, variables 'g:syntastic___quiet_messages' can be used to filter out some of the messages produced by specific checkers. The effect is identical to that of |syntastic_quiet_messages|, except only messages from the corresponding checkers are filtered. Example: >
let g:syntastic_python_pylama_quiet_messages = {"type": "style","regex": '\m\[C03\d\d\]' }

- 216
- 2
- 6
You may be able to edit the settings for your particular HTML linter/checker but you can also add the following to your .vimrc or enter as a command:
au BufNewFile,BufRead *.html set b:syntastic_skip_checks = 1
au is autocommand, such that when a .html buffer is opened, syntastic skips checking it. The b:
prefix only applies to the current buffer.

- 21
- 2
-
1This works, sort of, but it definitely isn't how you're supposed to do it, and it also isn't the proper use for `b:syntastic_skip_checks`. Read about passive filetypes in the manual instead. – Sato Katsura Aug 05 '15 at 03:49
-
Thanks for the pointer. Am I right in assuming that the arrays of types in `syntastic_mode_map` can be used to define just the exceptions to active checking ? – Eno Aug 05 '15 at 16:42