From 05575485291e4cde4d9a3980485f2f2a8488f47a Mon Sep 17 00:00:00 2001 From: Marcus Zanona Date: Thu, 2 Jun 2016 18:28:02 +0100 Subject: [PATCH 1/2] Add syntax fold support #56 Add code folding support by implementing syntax that will fold all tags except [void elements](http://www.w3.org/TR/html-markup/syntax.html#syntax-elements). This was an implementation suggested at http://vi.stackexchange.com/a/2333/3334. --- syntax/html.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syntax/html.vim b/syntax/html.vim index d979a90..eacf0cb 100644 --- a/syntax/html.vim +++ b/syntax/html.vim @@ -117,3 +117,5 @@ syn keyword htmlArg contained x x-height x1 x2 xChannelSelector xlink:actuate xl syn keyword htmlArg contained y y1 y2 yChannelSelector syn keyword htmlArg contained z zoomAndPan syn keyword htmlArg contained alignment-baseline baseline-shift clip-path clip-rule clip color-interpolation-filters color-interpolation color-profile color-rendering color cursor direction display dominant-baseline enable-background fill-opacity fill-rule fill filter flood-color flood-opacity font-family font-size-adjust font-size font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width stroke text-anchor text-decoration text-rendering unicode-bidi visibility word-spacing writing-mode + +syntax region htmlFold start="<\z(\<\(area\|base\|br\|col\|command\|embed\|hr\|img\|input\|keygen\|link\|meta\|para\|source\|track\|wbr\>\)\@![a-z-]\+\>\)\%(\_s*\_[^/]\?>\|\_s\_[^>]*\_[^>/]>\)" end="" fold transparent keepend extend containedin=htmlHead,htmlH\d From f50f325fe158d0002c64a0825ef017f9434ecc9a Mon Sep 17 00:00:00 2001 From: Marcus Zanona Date: Thu, 2 Jun 2016 23:12:57 +0100 Subject: [PATCH 2/2] fix typo over `param` rule --- syntax/html.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/html.vim b/syntax/html.vim index eacf0cb..6fb400a 100644 --- a/syntax/html.vim +++ b/syntax/html.vim @@ -118,4 +118,4 @@ syn keyword htmlArg contained y y1 y2 yChannelSelector syn keyword htmlArg contained z zoomAndPan syn keyword htmlArg contained alignment-baseline baseline-shift clip-path clip-rule clip color-interpolation-filters color-interpolation color-profile color-rendering color cursor direction display dominant-baseline enable-background fill-opacity fill-rule fill filter flood-color flood-opacity font-family font-size-adjust font-size font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width stroke text-anchor text-decoration text-rendering unicode-bidi visibility word-spacing writing-mode -syntax region htmlFold start="<\z(\<\(area\|base\|br\|col\|command\|embed\|hr\|img\|input\|keygen\|link\|meta\|para\|source\|track\|wbr\>\)\@![a-z-]\+\>\)\%(\_s*\_[^/]\?>\|\_s\_[^>]*\_[^>/]>\)" end="" fold transparent keepend extend containedin=htmlHead,htmlH\d +syntax region htmlFold start="<\z(\<\(area\|base\|br\|col\|command\|embed\|hr\|img\|input\|keygen\|link\|meta\|param\|source\|track\|wbr\>\)\@![a-z-]\+\>\)\%(\_s*\_[^/]\?>\|\_s\_[^>]*\_[^>/]>\)" end="" fold transparent keepend extend containedin=htmlHead,htmlH\d