Search code examples
vimdockerfilesyntastic

How do I make Syntastic work with the Dockerfile plugin?


I use the vim plugins Syntastic and Dockerfile.vim.

Syntastic has some checkers now for (lower-case) dockerfile file types, which is a built-in filetype for vim, but with only rudimentary syntax support. The better support with the Dockerfile.vim plugin sets a file type of (upper-cased) Dockerfile, which isn't detected by Syntastic.

I can locally tweak the Syntastic installation to copy the dockerfile checker directory to Dockerfile, and make a few associated case changes in the checker, but that seems clumsy.

Maybe there's a way to mess with my filetype detection so I simultaneously get the benefit of both plugins? Maybe Dockerfile.vim should be building on/replacing the dockerfile filetype, and not adding a new Dockerfile?

Any suggestions?


Solution

  • Per lcd047's comment above, Use syntastic_filetype_map:

    *'syntastic_filetype_map'* Type: dictionary Default: {} Use this option to map non-standard filetypes to standard ones. Corresponding checkers are mapped accordingly, which allows syntastic to check files with non-standard filetypes: > let g:syntastic_filetype_map = { \ "plaintex": "tex", \ "gentoo-metadata": "xml" }

    So: let g:syntastic_filetype_map = {"Dockerfile": "dockerfile"}