Closed bartoszek closed 5 years ago
Syntastic doesn't know, nor particularly cares, about file extensions. What it does instead is run checkers based on the filetype
s provided by Vim. Now, filetype
detection is Vim's job, syntastic just uses the result without questioning where / how / why the current filetype
came to be. So if you want syntastic to run properly you need to make sure the filetype
s associated to your files are correct.
As far as I can tell the filetype
for PKGBUILD
should be sh
. If automatic detection fails for your particular script for whatever reason, you can override it with a comment like this at the end of the file:
# vim: set filetype=sh
This will fix a number of things, and also tell syntastic your file is a shell script that can be checked as any other sh
file.
Thanks for a clarifying, it makes a lot more sense now.
I've noticed that vim
has a defined filetype
for a PKGBUILD
(set filetype? > filetype=PKBUILD
).
Is there a way to incorporate a new filetype in syntastics
configuration?
I've treid leverage autocmd
with b:syntastic_checkers
but without success.
I've noticed that
vim
has a definedfiletype
for aPKGBUILD
(set filetype? > filetype=PKBUILD
).
As far as I can tell the PKGBUILD
filetype is added by a standalone plugin (or some such), not by plain Vim. But yes, syntastic does have mechanisms to cope with that. F.i. like this:
let g:syntastic_filetype_map = { 'PKGBUILD': 'sh' }
(cf. :h 'syntastic_filetype_map'
).
Yep, works like a charm, appreciate your help :+1:
Would be nice if
#!/hint
also enable syntastic, not onlyfile extension
Or am I doing something wrong :thinking: