diff --git a/doc/filetype.jax b/doc/filetype.jax index f7062a1fc..88562e1d0 100644 --- a/doc/filetype.jax +++ b/doc/filetype.jax @@ -1,4 +1,4 @@ -*filetype.txt* For Vim バージョン 9.1. Last change: 2025 Apr 27 +*filetype.txt* For Vim バージョン 9.1. Last change: 2025 May 10 VIMリファレンスマニュアル by Bram Moolenaar @@ -693,6 +693,32 @@ HARE *ft-hare* このプラグインのテキストはかなり長いため、別ファイル |ft_hare.txt| に配置され ている: |ft_hare.txt|。 +HTML *ft-html-plugin* + +タグの折り畳みにはいくつかの難しさがある。多くの要素、例えば `blockquote` は常 +に開始タグと終了タグで区切られる。一方、一部の要素、例えば `p` の終了タグは、 +特定のコンテキストでは省略可能である。一方、空要素、例えば `hr` には終了タグが +ない。省略可能な終了タグをサポートするためのルールはアドホックで複雑だが [0]、 +スコープ内の要素に適用される。構文的に整形式性があると仮定すると、終了タグはス +コープ内 [1] およびファイルの先頭付近で発見可能な最も近い開始タグと関連付ける +ことができる。一方、不均衡なタグやインラインタグはすべて無視できる。構文ハイラ +イトが有効になっている場合、|fold-expr| メソッドを用いたタグの折り畳みは以下で +有効にできる: > + let g:html_expr_folding = 1 +< +デフォルトでは、|TextChanged| または |InsertLeave| イベントが発生するたびに、 +タグの折り畳みが最初からやり直される。特に大きなファイルの場合、このような頻度 +は望ましくない場合がある。この再計算は以下で無効にできる: > + let g:html_expr_folding_without_recomputation = 1 + doautocmd FileType +< +再計算を強制するには、以下のようにする: > + unlet! b:foldsmap + normal zx +< +[0] https://html.spec.whatwg.org/multipage/syntax.html#optional-tags +[1] https://en.wikipedia.org/wiki/Dangling_else + IDRIS2 *ft-idris2-plugin* デフォルトでは、以下のオプションが設定されている: > diff --git a/en/filetype.txt b/en/filetype.txt index fa9506da2..63d7b030e 100644 --- a/en/filetype.txt +++ b/en/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 9.1. Last change: 2025 Apr 27 +*filetype.txt* For Vim version 9.1. Last change: 2025 May 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -702,6 +702,32 @@ HARE *ft-hare* Since the text for this plugin is rather long it has been put in a separate file: |ft_hare.txt|. +HTML *ft-html-plugin* + +Tag folding poses a few difficulties. Many elements, e.g. `blockquote`, are +always delimited by start and end tags; end tags for some elements, e.g. `p`, +can be omitted in certain contexts; void elements, e.g. `hr`, have no end tag. +Although the rules for supporting omissible end tags are ad-hoc and involved +[0], they apply to elements in scope. Assuming syntactical wellformedness, an +end tag can be associated with its nearest matching start tag discoverable in +scope [1] and towards the beginning of a file, whereas all unbalanced tags and +inlined tags can be disregarded. Having syntax highlighting in effect, tag +folding using the |fold-expr| method can be enabled with: > + let g:html_expr_folding = 1 +< +By default, tag folding will be redone from scratch after each occurrence of +a |TextChanged| or an |InsertLeave| event. Such frequency may not be desired, +especially for large files, and this recomputation can be disabled with: > + let g:html_expr_folding_without_recomputation = 1 + doautocmd FileType +< +To force another recomputation, do: > + unlet! b:foldsmap + normal zx +< +[0] https://html.spec.whatwg.org/multipage/syntax.html#optional-tags +[1] https://en.wikipedia.org/wiki/Dangling_else + IDRIS2 *ft-idris2-plugin* By default the following options are set: >