summaryrefslogtreecommitdiffstats
path: root/runtime/filetype.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-11 21:38:50 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-11 21:38:50 +0000
commit4c3f536f472c7443ed4f672ae6d35a28805d7641 (patch)
tree18d0d8df6d45ff21449a017068aea2ba0931bd57 /runtime/filetype.vim
parent779b74b2a23643aaac026341a4ed8bd6e04371e6 (diff)
updated for version 7.0d01v7.0d01
Diffstat (limited to 'runtime/filetype.vim')
-rw-r--r--runtime/filetype.vim19
1 files changed, 17 insertions, 2 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 8d1f155eb3..3aa1ee79ce 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2006 Apr 04
+" Last Change: 2006 Apr 11
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -784,6 +784,9 @@ au BufNewFile,BufRead *.k setf kwt
" KDE script
au BufNewFile,BufRead *.ks setf kscript
+" Kconfig
+au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig
+
" Lace (ISE)
au BufNewFile,BufRead *.ace,*.ACE setf lace
@@ -1662,13 +1665,25 @@ au BufNewFile,BufRead /etc/sysctl.conf setf sysctl
" Sudoers
au BufNewFile,BufRead /etc/sudoers,sudoers.tmp setf sudoers
+" If the file has an extension of 't' and is in a directory 't' then it is
+" almost certainly a Perl test file.
" If the first line starts with '#' and contains 'perl' it's probably a Perl
" file.
+" (Slow test) If a file contains a 'use' statement then it is almost certainly
+" a Perl file.
fun! s:FTperl()
+ if expand("%:e") == 't' && expand("%:p:h:t") == 't'
+ setf perl
+ return 1
+ endif
if getline(1)[0] == '#' && getline(1) =~ 'perl'
setf perl
return 1
endif
+ if search('^use\s\s*\k', 'nc', 30)
+ setf perl
+ return 1
+ endif
return 0
endfun
@@ -1961,7 +1976,7 @@ au BufNewFile,BufRead *.yaml,*.yml setf yaml
" Zope
" dtml (zope dynamic template markup language), pt (zope page template),
" cpt (zope form controller page template)
-au BufNewFile,BufRead *.dtml,*.pt,*.cpt call <SID>FTCheck_html()
+au BufNewFile,BufRead *.dtml,*.pt,*.cpt call s:FThtml()
" zsql (zope sql method)
au BufNewFile,BufRead *.zsql call s:SQL()