diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-24 09:24:13 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-24 09:24:13 +0200 |
commit | 6b4da2753814cc61cd842c589d829f03cd7ca98d (patch) | |
tree | 52beb70126e19a93eab504217b7ecd2354473b35 /autoload | |
parent | c284af58fa13ad9fdd831f57d31dc4688977ae94 (diff) | |
download | vim-polyglot-6b4da2753814cc61cd842c589d829f03cd7ca98d.tar.gz vim-polyglot-6b4da2753814cc61cd842c589d829f03cd7ca98d.zip |
Improve html heuristics
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/polyglot.vim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/autoload/polyglot.vim b/autoload/polyglot.vim index 325287fc..d8ee601f 100644 --- a/autoload/polyglot.vim +++ b/autoload/polyglot.vim @@ -372,9 +372,12 @@ func! polyglot#DetectHtmlFiletype() endif for lnum in range(1, min([line("$"), 50])) let line = getline(lnum) - if line =~# '{{.*}}\|{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)' + if line =~# '{{.*}}\|{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)\|{#\s\+' set ft=jinja.html | return endif + if line =~# '\(\<\|\>\)DTD\s\+XHTML\s' + set ft=xhtml | return + endif endfor set ft=html | return endfunc |