The default filetype of a file with .pl
extension is perl.
However I use prolog more often so every time I open a new file I have to set it manually by running vim command
:set filetype=prolog
I tried to automate it by inserting the the following line into ~/.vimrc
autocmd BufNewFile,BufRead *.pl set syntax=prolog
also tried inserting this line in .vim/ftdetect/pl.vim
file in vain.
What should be done to set .pl
files to prolog type instead of perl?
Vim should detect this automatically, but you can override this by setting the variable g:filetype_pl in your .vimrc accordingly: