Vim perl filetype detection

rafael on 2002-05-21T12:16:28

I finally managed to have a better filetype detection for Perl from vim. Here's my new ~/.vim/filetype.vim file :

if exists("did_load_filetypes") finish endif

function FT_check_pod() if getline(nextnonblank(1)) =~ '^=head' setf pod endif endfunction

augroup filetypedetect au BufNewFile,BufRead * call FT_check_pod() au BufNewFile,BufRead *.t setf perl augroup END

Additionally, to help me editing pods, I have this single line in ~/.vim/ftplugin/pod.vim :

set tw=74