It looks like Vim will automatically detect prolog rather than Perl if the first non-blank line contains any of:
1. the word "prolog"
2. a prolog comment, % or /* ... */
3. the prolog :- construct
Otherwise, Vim detects Perl. So for existing files, just get into the habit of starting the file with a header comment and you'll be fine.
I guess new files will always detect as Perl, but there's really not any way I can think of for Vim to detect in a general way what filetype a brand-new empty file should be. You could set up some BufNewFile autocmds based on project directory or something if you like for this.
It looks like Vim will automatically detect prolog rather than Perl if the first non-blank line contains any of:
1. the word "prolog"
2. a prolog comment, % or /* ... */
3. the prolog :- construct
Otherwise, Vim detects Perl. So for existing files, just get into the habit of starting the file with a header comment and you'll be fine.
I guess new files will always detect as Perl, but there's really not any way I can think of for Vim to detect in a general way what filetype a brand-new empty file should be. You could set up some BufNewFile autocmds based on project directory or something if you like for this.