Mercurial > vim
comparison runtime/filetype.vim @ 798:95dac6af3b3a v7.0232
updated for version 7.0232
author | vimboss |
---|---|
date | Thu, 23 Mar 2006 22:59:57 +0000 |
parents | f19994020dad |
children | d8f905020502 |
comparison
equal
deleted
inserted
replaced
797:a1a08851eac8 | 798:95dac6af3b3a |
---|---|
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: 2006 Mar 21 | 4 " Last Change: 2006 Mar 23 |
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 |
636 au BufNewFile,BufRead *.t.html setf tilde | 636 au BufNewFile,BufRead *.t.html setf tilde |
637 | 637 |
638 " HTML (.shtml and .stm for server side) | 638 " HTML (.shtml and .stm for server side) |
639 au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml() | 639 au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml() |
640 | 640 |
641 " Distinguish between HTML and XHTML | 641 " Distinguish between HTML, XHTML and Django |
642 fun! s:FThtml() | 642 fun! s:FThtml() |
643 let n = 1 | 643 let n = 1 |
644 while n < 10 && n < line("$") | 644 while n < 10 && n < line("$") |
645 if getline(n) =~ '\<DTD\s\+XHTML\s' | 645 if getline(n) =~ '\<DTD\s\+XHTML\s' |
646 setf xhtml | 646 setf xhtml |
647 return | |
648 endif | |
649 if getline(n) =~ '{%\s*\(extends\|block\)\>' | |
650 setf htmldjango | |
647 return | 651 return |
648 endif | 652 endif |
649 let n = n + 1 | 653 let n = n + 1 |
650 endwhile | 654 endwhile |
651 setf html | 655 setf html |