-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfiletype.vim
32 lines (28 loc) · 1.01 KB
/
filetype.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au! BufNewFile,BufRead svk-commit*.tmp setf svk
au! BufNewFile,BufRead mason/*.html setf mason
au BufRead,BufNewFile *.mas set ft=mason
au! BufNewFile,BufRead *.t setf perltest
au! BufNewFile,BufRead *.hwd setf hwd
au! BufNewFile,BufRead *.st setf wiki
au! BufNewFile,BufRead *.wiki setf wiki
au! BufNewFile,BufRead *.html
\ if ( getline(1) . getline(2) . getline(3) =~ '\[%' ) |
\ setf tt2html |
\ else |
\ setf html |
\ endif
au BufNewFile,BufRead *.tt2
\ if ( getline(1) . getline(2) . getline(3) =~ '<\chtml'
\ && getline(1) . getline(2) . getline(3) !~ '<[%?]' )
\ || getline(1) =~ '<!DOCTYPE HTML' |
\ setf tt2html |
\ else |
\ setf tt2 |
\ endif
"TT2 and HTML"
:let b:tt2_syn_tags = '\[% %] <!-- -->'
augroup END