aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-09 14:16:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-09 14:16:06 +1200
commit84c5cd6551c5f4df4974896670c83ef7f73dd374 (patch)
treee37671c0d85d8597de0292912f037b308a29f01a
parentad0a1fdec64ba686d6e75738755cf4d3b5b03e8d (diff)
downloaddotfiles-84c5cd6551c5f4df4974896670c83ef7f73dd374.tar.gz
Add extra Perl file detection rules
-rw-r--r--Makefile6
-rw-r--r--vim/ftdetect/perl.vim9
2 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c879db4c..e3e0ad38 100644
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,7 @@
install-vim-compiler \
install-vim-config \
install-vim-filetype \
+ install-vim-ftdetect \
install-vim-ftplugin \
install-vim-gui \
install-vim-gui-config \
@@ -502,6 +503,7 @@ install-vim: install-vim-after \
install-vim-compiler \
install-vim-config \
install-vim-filetype \
+ install-vim-ftdetect \
install-vim-ftplugin \
install-vim-indent \
install-vim-plugin
@@ -561,6 +563,10 @@ install-vim-config:
install-vim-filetype:
cp -p -- vim/filetype.vim vim/scripts.vim $(VIMDIR)
+install-vim-ftdetect:
+ mkdir -p -- $(VIMDIR)/ftdetect
+ cp -p -- vim/ftdetect/*.vim $(VIMDIR)/ftdetect
+
install-vim-ftplugin:
mkdir -p -- $(VIMDIR)/ftplugin
cp -p -- vim/ftplugin/*.vim $(VIMDIR)/ftplugin
diff --git a/vim/ftdetect/perl.vim b/vim/ftdetect/perl.vim
new file mode 100644
index 00000000..8b2e1b4e
--- /dev/null
+++ b/vim/ftdetect/perl.vim
@@ -0,0 +1,9 @@
+" If it's a new file in a bin, libexec, or scripts subdir that has a
+" Makefile.PL, it's almost definitely Perl.
+autocmd BufNewFile
+ \ */bin/*
+ \,*/libexec/*
+ \,*/scripts/*
+ \ if filereadable(expand('<afile>:p:h:h') . '/Makefile.PL')
+ \| setfiletype perl
+ \|endif