Tuesday May 21, 2002
07:16 AM
Vim perl filetype detection
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 <SID>FT_check_pod()
if getline(nextnonblank(1)) =~ '^=head'
setf pod
endif
endfunction
augroup filetypedetect
au BufNewFile,BufRead * call <SID>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
Vim perl filetype detection 0 Comments More | Login | Reply /