I'm using a syntax highlight plugin for Nginx files. Its ftdetect
looks like this:
au BufRead,BufNewFile *.nginx set ft=nginx
au BufRead,BufNewFile nginx*.conf set ft=nginx
au BufRead,BufNewFile *nginx.conf set ft=nginx
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
au BufRead,BufNewFile */nginx/*.conf set ft=nginx
It works well with local configuration files, but when I open a file which is outside the list of predefined directories, there is no syntax highlighting, even when the file ends by the following line:
# vim: syntax=nginx ts=4 sw=4 sts=4
If, inside vim, I run :setf nginx
, then the syntax is back.
How do I change ftdetect
to be able to benefit from syntax highlighting automatically based on the presence of # vim: syntax=nginx
?