summaryrefslogtreecommitdiffstats
path: root/runtime/filetype.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-04-12 15:09:51 +0200
committerBram Moolenaar <Bram@vim.org>2013-04-12 15:09:51 +0200
commit0187ca0bdf0d7e5afc5ea80b390dc7e1fc983829 (patch)
treeab53cd1755d309dd8d0d81c34ba160abf3c13e17 /runtime/filetype.vim
parent38ec50bea8ecb60fa4dd50cfca7c29c98a7a8df0 (diff)
Updated runtime files.
Diffstat (limited to 'runtime/filetype.vim')
-rw-r--r--runtime/filetype.vim20
1 files changed, 15 insertions, 5 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index eade491828..065f1ddf5b 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: 2013 Apr 06
+" Last Change: 2013 Apr 08
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -1638,10 +1638,6 @@ func! s:FTr()
endif
endfunc
-" ReDIF
-" TODO: Not all .rdf files are redif, need a better way to detect.
-" au BufRead,BufNewFile *.rdf setf redif
-
" Remind
au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind
@@ -2567,6 +2563,20 @@ au BufNewFile,BufRead *termcap*
\| let b:ptcap_type = "term" | call s:StarSetf('ptcap')
\|endif
+" ReDIF
+" Only used when the .rdf file was not detected to be XML.
+au BufRead,BufNewFile *.rdf call s:Redif()
+func! s:Redif()
+ let lnum = 1
+ while lnum <= 5 && lnum < line('$')
+ if getline(lnum) =~ "^\ctemplate-type:"
+ setf redif
+ return
+ endif
+ let lnum = lnum + 1
+ endwhile
+endfunc
+
" Remind
au BufNewFile,BufRead .reminders* call s:StarSetf('remind')