Files
vim-jinja/ftdetect/jinja.vim
2013-01-27 02:18:50 +08:00

14 lines
369 B
VimL

" Figure out which type of hilighting to use for html.
fun! s:SelectHTML()
let n = 1
while n < 50 && n < line("$")
" check for jinja
if getline(n) =~ '{%\s*\(extends\|block\|macro\|set\|if\|for\|include\|trans\)\>'
set ft=jinja
return
endif
let n = n + 1
endwhile
endfun
autocmd BufNewFile,BufRead *.jinja2,*.jinja,*.html,*.htm call s:SelectHTML()