From 5b77877888162f4e415fe9a7b8c5e9fb5dfb6ee1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 27 Sep 2017 20:43:42 +0200 Subject: Add syntax files from upstream vim repository --- autoload/htmlcomplete.vim | 812 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 812 insertions(+) (limited to 'autoload/htmlcomplete.vim') diff --git a/autoload/htmlcomplete.vim b/autoload/htmlcomplete.vim index fc9a4b5a..1ef80e35 100644 --- a/autoload/htmlcomplete.vim +++ b/autoload/htmlcomplete.vim @@ -1,3 +1,815 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vim') == -1 + +" Vim completion script +" Language: HTML and XHTML +" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) +" Last Change: 2014 Jun 20 + +" Distinguish between HTML versions. +" To use with other HTML versions add another "elseif" condition to match +" proper DOCTYPE. +function! htmlcomplete#DetectOmniFlavor() + if &filetype == 'xhtml' + let b:html_omni_flavor = 'xhtml10s' + else + let b:html_omni_flavor = 'html401t' + endif + let i = 1 + let line = "" + while i < 10 && i < line("$") + let line = getline(i) + if line =~ '' + let b:html_omni_flavor = 'html40' + endif + if line =~ '\' + let b:html_omni_flavor .= 't' + elseif line =~ '\' + let b:html_omni_flavor .= 'f' + else + let b:html_omni_flavor .= 's' + endif + endif + endif +endfunction + +function! htmlcomplete#CompleteTags(findstart, base) + if a:findstart + " locate the start of the word + let line = getline('.') + let start = col('.') - 1 + let curline = line('.') + let compl_begin = col('.') - 2 + while start >= 0 && line[start - 1] =~ '\(\k\|[!:.-]\)' + let start -= 1 + endwhile + " Handling of entities {{{ + if start >= 0 && line[start - 1] =~ '&' + let b:entitiescompl = 1 + let b:compl_context = '' + return start + endif + " }}} + " Handling of