aboutsummaryrefslogtreecommitdiff
path: root/vim/filetype.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/filetype.vim')
-rw-r--r--vim/filetype.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/vim/filetype.vim b/vim/filetype.vim
index d7ca5255..9d6c6eb7 100644
--- a/vim/filetype.vim
+++ b/vim/filetype.vim
@@ -462,6 +462,16 @@ augroup filetypedetect
\,zshrc
\ setfiletype zsh
+ " If it's a new file in a bin, libexec, or scripts subdir that has a
+ " Makefile.PL sibling, and I'm editing it, it's almost definitely Perl.
+ autocmd BufNewFile
+ \ ?*/bin/?*
+ \,?*/libexec/?*
+ \,?*/scripts/?*
+ \ if filereadable(expand('<afile>:p:h:h') . '/Makefile.PL')
+ \| setfiletype perl
+ \|endif
+
" Load any extra rules in ftdetect directories
runtime! ftdetect/*.vim