How to selectively disable checks for certain file types when using syntax in vim?

For example, partial HTML templates are flagged with many errors, but they must be fragments of a complete HTML document.

+4
source share
2 answers

In .vimrc :

 let g:syntastic_mode_map = { \ "mode": "active", \ "passive_filetypes": ["go"] } 

This sets Syntastic to active mode (checks are performed when saving or opening), but not for Go files, in this case, which will be checked only when explicitly launched :SyntasticCheck . Just change the passive_filetypes array to whatever you need.

+8
source

You may be able to edit the settings for your specific linter / checker HTML, 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 an autocommand, so when the .html buffer is open, syntax omissions check it. Prefix b: applies only to the current buffer.

0
source

All Articles