For example, HTML partial templates are being flagged with tons of errors but they are supposed to be fragments of a complete HTML doc.
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.
"passive_filetypes": ["go", "html"]
? –
Nano 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\]' }
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.
b:syntastic_skip_checks
. Read about passive filetypes in the manual instead. –
Mercenary syntastic_mode_map
can be used to define just the exceptions to active checking ? –
Nano © 2022 - 2024 — McMap. All rights reserved.
:help syntastic-quickstart
and:help 'syntastic_mode_map'
. – Mercenary