Say I have a new filetype I'm defining for my project that is .jays, which is very similar to a javascript (.js) file but slightly different.
As far as I can tell there is no way to tell Syntastic to run my javascript checker on .jays files. Unless there is in fact a way and I missed it, could we add support for this?
There is in fact a way, and you missed it. :) You might do something like this:
augroup filetype
autocmd! BufRead,BufNewFile *.jays set filetype=jays
augroup END
let g:syntastic_filetype_map = { "jays": "javascript" }
Thanks for the help, but this doesn't seem to be working.
This is everything I have in my .vimrc for Syntastic (note that the extension is actually .template):
17 let g:syntastic_filetype_map = { "template": "javascript" }
18 " Enable syntastic checker for JS
19 let g:syntastic_check_on_open=1
20 let g:syntastic_enable_highlighting=1
21 let g:syntastic_javascript_checkers=['gjslint']
22 let g:syntastic_enable_signs=1
23 let g:syntastic_auto_jump=0
24 let g:syntastic_stl_format='[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
25 let g:syntastic_mode_map = { 'mode': 'active',
26 \ 'active_filetypes': ['js', 'html', 'template'],
27 \ 'passive_filetypes': ['java'] }
28
29 " Enable JS syntax for .template
30 augroup filetype
31 autocmd! BufRead,BufNewFile *.template set filetype=template
32 augroup END
Please define "doesn't seem to be working". What did you do, what did you expect to happen, and what happened instead?
Sorry. Opened a file with a ".template" extension in vim, and another file with a ".js" extension in vim (with the .vimrc shown above -- I copied and pasted that wrong, the first line (# 17) should actually be at the bottom, on line # 33. Sorry).
I expected to see syntax highlighting in both, but I only see syntax highlighting in the .js file.
You are confused. Syntastic doesn't have anything to do with syntax highlighting (not in the sense you mean it anyway).
I can confirm that I am in fact a very confused little boy.
This was all I needed:
au BufRead,BufNewFile *.template set filetype=javascript
Most helpful comment
There is in fact a way, and you missed it. :) You might do something like this: