mirror of
https://github.com/lepture/vim-jinja.git
synced 2025-11-14 22:33:49 -05:00
15 lines
414 B
VimL
15 lines
414 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 *.html,*.htm call s:SelectHTML()
|
|
autocmd BufNewFile,BufRead *.j2,*.jinja2,*.jinja set ft=jinja
|