comparison runtime/filetype.vim @ 3224:8b8ef1fed009

Update runtime files.
author Bram Moolenaar <bram@vim.org>
date Wed, 14 Dec 2011 21:17:39 +0100
parents 37ecb8ff4560
children 91e53bcb7946
comparison
equal deleted inserted replaced
3223:576648218cb5 3224:8b8ef1fed009
1 " Vim support file to detect file types 1 " Vim support file to detect file types
2 " 2 "
3 " Maintainer: Bram Moolenaar <Bram@vim.org> 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last Change: 2011 Oct 08 4 " Last Change: 2011 Oct 26
5 5
6 " Listen very carefully, I will say this only once 6 " Listen very carefully, I will say this only once
7 if exists("did_load_filetypes") 7 if exists("did_load_filetypes")
8 finish 8 finish
9 endif 9 endif
564 " the D language or dtrace 564 " the D language or dtrace
565 au BufNewFile,BufRead *.d call s:DtraceCheck() 565 au BufNewFile,BufRead *.d call s:DtraceCheck()
566 566
567 func! s:DtraceCheck() 567 func! s:DtraceCheck()
568 let lines = getline(1, min([line("$"), 100])) 568 let lines = getline(1, min([line("$"), 100]))
569 if match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1 569 if match(lines, '^module\>\|^import\>') > -1
570 " D files often start with a module and/or import statement.
571 setf d
572 elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1
570 setf dtrace 573 setf dtrace
571 else 574 else
572 setf d 575 setf d
573 endif 576 endif
574 endfunc 577 endfunc