diff --git a/doc/syntax.jax b/doc/syntax.jax index 81f70d3b6..f417b635d 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -1,4 +1,4 @@ -*syntax.txt* For Vim バージョン 8.1. Last change: 2019 Oct 27 +*syntax.txt* For Vim バージョン 8.2. Last change: 2019 Dec 19 VIMリファレンスマニュアル by Bram Moolenaar @@ -465,6 +465,15 @@ Note -s フラグは .vimrc とプラグインの読み込みを抑制する。 ようなことがらをすべてスクリプトファイルに書き込み、-u フラグで読み込んで実行 するといいだろう。 + *hl-TOhtmlProgress* *TOhtml-progress-color* +プログレスバーは HTML 変換が進むにつれ、ステータスラインに沿って色付きの四角で +表示される。デフォルトでは背景色は現在の "DiffDelete" ハイライトグループの設定 +が適用される。"DiffDelete" と "StatusLine" の背景色が同じ場合、TOhtml は自動で +色を調整する。自動で色を選択したくない場合は、自身でプログレスバーのハイライト +色を定義することができる。例えば: > + + hi TOhtmlProgress guifg=#c0ffee ctermbg=7 +< *g:html_number_lines* 初期設定: 現在の 'number' の設定 0 なら、バッファのテキストは行番号なしで HTML に表示される。 @@ -496,8 +505,8 @@ Javascript が挿入される (|g:html_dynamic_folds|)。javascript はウィン < *g:html_use_css* 初期設定: 1 -1 なら、CSS1 で装飾された HTML 4.01 準拠の HTML が生成される。最新のブラウザー -とほとんどの古いブラウザーでサポートされている。 +1 なら、CSS で装飾された HTML 5 準拠の HTML が生成される。最新のブラウザーと多 +くの古いブラウザーでサポートされている。 0 なら、 タグで装飾された時代遅れの HTML が生成される。これは推奨されて いないが、古いブラウザー、あるいはメーラーや掲示板の投稿など、CSS が使えない場 合には必要だろう。 @@ -567,20 +576,40 @@ CSS を使うようになる。 例えば、foldcolumn と行番号をコピーできないようにするには: > :let g:html_prevent_copy = "fn" < -この機能は現在、コピー抑制エリアに読み込み専用の 要素を挿入することで -実装されている。これはすべての場合で機能するわけではない。他の、HTML を解釈す -るアプリケーションにペーストすると、 要素もペーストされる。しかしプレー -ンテキストとしてのペーストなら常に機能するだろう。 +生成されたページのコピーを防ぐための方法は |g:html_use_input_for_pc| の値に依 +存している。 + + *g:html_use_input_for_pc* +初期設定: "fallback" +|g:html_prevent_copy| の値が空文字列でないとき: + +"all" なら、コピー抑制エリアにある通常テキストの代わりに読み込み専用の +要素を使用する。古いブラウザーなどいくつかのブラウザーでは、ページ全体を選択し +コピーした後、 タグはページテキストと共にペーストされない。もし +|g:html_no_invalid| が 0 ならば、 タグは不正な属性を持つ。これにより大 +抵のブラウザーで機能するようになるが、ページは正しくない。 +Note: この方法は最近の Chrome やそれと同等なブラウザーでは動作しない。 +タグはテキストと共にペーストされてしまう。 + +"fallback" なら (これは初期設定値である)、古いブラウザーのために同様に +要素を生成するが、コピー抑制テキストを表示するために新しいブラウザー (これは +CSS 機能クエリで決定される) では 要素を隠し、::before 疑似要素で生成し +たコンテンツを代わりに使用する。この方法は新旧ほとんどのブラウザーで機能する。 + +"none" なら 要素は生成されない。コンテンツを生成する方法のみが使用され +る。これは Internet Explorer のような古いブラウザーでは、コピーできないように +意図されたテキストがコピーできるか、コピー抑制テキストが全く表示されないことを +意味する。ただし、これが最も標準的な方法でマークアップも少なくなる。 *g:html_no_invalid* 初期設定: 0 -0 なら、もし |g:html_prevent_copy| が空でなければ、コピー抑制エリアのための - エレメントに不正な属性が意図的に挿入される。これによって、 要素 -がペーストされてしまうような場合でもいくつかのアプリケーションは対応可能とな -る。特に、Microsoft Word は不正な属性を持つ 要素をペーストしない。 -1 なら、不正な属性は挿入されない。正しいページが生成される。ただ -し、|g:html_prevent_copy| が空でないときに、Microsoft Word にペーストするには -注意が必要である。 要素がペーストされないようにするのは困難だ。 +0 なら、もし |g:html_prevent_copy| が空でなく |g:html_use_input_for_pc| も +"none" でない場合、コピー抑制エリアのための エレメントに不正な属性が意 +図的に挿入される。これによって、いくつかのアプリケーションで 要素がペー +ストされることを防ぐ。特に、いくつかのバージョンの Microsoft Word では不正な属 +性を持つ 要素をペーストしない。1 なら、不正な属性は挿入されない。正し +いページが生成される。ただし、いくつかのアプリケーションでは 要素はペー +ストされてしまい、後で削除するのが困難になる。 *g:html_hover_unfold* 初期設定: 0 @@ -910,10 +939,12 @@ Basicとして扱われる。 C *c.vim* *ft-c-syntax* Cには幾つかの補助的なハイライト方法がある。それらを有効化するには対応した変数 -に値を設定する。例: > +に値 (0 を含む) を設定する。例: > :let c_comment_strings = 1 -これを無効化するには ":unlet" を使う。例: > + :let c_no_bracket_error = 0 +これを無効化するには `:unlet` を使う。例: > :unlet c_comment_strings +0 に変更しても無効化されない! 代わりに、C++ のハイライトに切り替える方法もある: > :set filetype=cpp @@ -929,8 +960,9 @@ Cには幾つかの補助的なハイライト方法がある。それらを有 をエラーとして表示しない。 デフォルトでエラーとして表示される。欠落した ")" を見つけられないため。 -*c_curly_error* 対応する { がない } をハイライトする。これを有効にする - と、ファイルの先頭から同期が始まるため、遅くなる +*c_curly_error* 全てのペアを検証することにより対応する { がない } をハ + イライトする。これを有効にすると、ファイルの先頭から同 + 期が 始まるため、遅くなる *c_no_ansi* ANSI標準の型と定数をハイライトしない *c_ansi_typedefs* ... 但し標準ANSI型はハイライトする *c_ansi_constants* ... 但し標準ANSI定数はハイライトする @@ -2631,6 +2663,13 @@ readlineライブラリは主としてBASHシェルで使われ、BASHはかな トするようになる。 +REGO *rego.vim* *ft-rego-syntax* + +Rego は Styra が開発したクエリ言語である。主に kubernetes のポリシー言語として +使用されるが、ほぼ全てのアプリケーションに適用できる。次の拡張子のファイルが +rego ファイルとして認識される: .rego + + RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax* 選択したファイルタイプの数について、文書内のコードブロックに対して構文ハイライ @@ -2643,10 +2682,10 @@ RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax* 複数のコードブロックタイプを単一の構文に割り当てるには、マッピングとして `rst_syntax_code_list` を定義する: > let rst_syntax_code_list = { - \ 'cpp' = ['cpp', 'c++'], - \ 'bash' = ['bash', 'sh'], + \ 'cpp': ['cpp', 'c++'], + \ 'bash': ['bash', 'sh'], ... - } + \ } 強調テキストにカラーハイライトを使用するには: > let rst_use_emphasis_colors = 1 @@ -4679,7 +4718,7 @@ cterm={attr-list} *highlight-cterm* メントを青色で表示することができる。 Note: DOSコンソールなどいくつかのターミナルでは色づけの際にこれらの属 性を混在させることはできない。移植性を重視するには、"cterm=" か - "ctermfg=" が "ctermbg=" のどれか1つだけを使うこと。 + "ctermfg=" か "ctermbg=" のどれか1つだけを使うこと。 ctermfg={color-nr} *highlight-ctermfg* *E421* ctermbg={color-nr} *highlight-ctermbg* diff --git a/en/syntax.txt b/en/syntax.txt index 99a99c406..b1a1d0fe2 100644 --- a/en/syntax.txt +++ b/en/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 8.1. Last change: 2019 Oct 27 +*syntax.txt* For Vim version 8.2. Last change: 2019 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -476,6 +476,16 @@ conversion. See |-E| and |-s-ex| for details. It is probably best to create a script to replace all the -c commands and use it with the -u flag instead of specifying each command separately. + *hl-TOhtmlProgress* *TOhtml-progress-color* +When displayed, the progress bar will show colored boxes along the statusline +as the HTML conversion proceeds. By default, the background color as the +current "DiffDelete" highlight group is used. If "DiffDelete" and "StatusLine" +have the same background color, TOhtml will automatically adjust the color to +differ. If you do not like the automatically selected colors, you can define +your own highlight colors for the progress bar. Example: > + + hi TOhtmlProgress guifg=#c0ffee ctermbg=7 +< *g:html_number_lines* Default: current 'number' setting. When 0, buffer text is displayed in the generated HTML without line numbering. @@ -507,8 +517,8 @@ For example: > < *g:html_use_css* Default: 1. -When 1, generate valid HTML 4.01 markup with CSS1 styling, supported in all -modern browsers and most old browsers. +When 1, generate valid HTML 5 markup with CSS styling, supported in all modern +browsers and many old browsers. When 0, generate tags and similar outdated markup. This is not recommended but it may work better in really old browsers, email clients, forum posts, and similar situations where basic CSS support is unavailable. @@ -580,23 +590,43 @@ affected in this way as follows: Example, to make the fold column and line numbers uncopyable: > :let g:html_prevent_copy = "fn" < -This feature is currently implemented by inserting read-only elements -into the markup to contain the uncopyable areas. This does not work well in -all cases. When pasting to some applications which understand HTML, the - elements also get pasted. But plain-text paste destinations should -always work. +The method used to prevent copying in the generated page depends on the value +of |g:html_use_input_for_pc|. + + *g:html_use_input_for_pc* +Default: "fallback" +If |g:html_prevent_copy| is non-empty, then: + +When "all", read-only elements are used in place of normal text for +uncopyable regions. In some browsers, especially older browsers, after +selecting an entire page and copying the selection, the tags are not +pasted with the page text. If |g:html_no_invalid| is 0, the tags have +invalid type; this works in more browsers, but the page will not validate. +Note: this method does NOT work in recent versions of Chrome and equivalent +browsers; the tags get pasted with the text. + +When "fallback" (default value), the same elements are generated for +older browsers, but newer browsers (detected by CSS feature query) hide the + elements and instead use generated content in an ::before pseudoelement +to display the uncopyable text. This method should work with the largest +number of browsers, both old and new. + +When "none", the elements are not generated at all. Only the +generated-content method is used. This means that old browsers, notably +Internet Explorer, will either copy the text intended not to be copyable, or +the non-copyable text may not appear at all. However, this is the most +standards-based method, and there will be much less markup. *g:html_no_invalid* Default: 0. -When 0, if |g:html_prevent_copy| is non-empty, an invalid attribute is -intentionally inserted into the element for the uncopyable areas. This -increases the number of applications you can paste to without also pasting the - elements. Specifically, Microsoft Word will not paste the -elements if they contain this invalid attribute. -When 1, no invalid markup is ever intentionally inserted, and the generated -page should validate. However, be careful pasting into Microsoft Word when -|g:html_prevent_copy| is non-empty; it can be hard to get rid of the -elements which get pasted. +When 0, if |g:html_prevent_copy| is non-empty and |g:html_use_input_for_pc| is +not "none", an invalid attribute is intentionally inserted into the +element for the uncopyable areas. This prevents pasting the elements +in some applications. Specifically, some versions of Microsoft Word will not +paste the elements if they contain this invalid attribute. When 1, no +invalid markup is inserted, and the generated page should validate. However, + elements may be pasted into some applications and can be difficult to +remove afterward. *g:html_hover_unfold* Default: 0. @@ -936,10 +966,12 @@ Basic. C *c.vim* *ft-c-syntax* A few things in C highlighting are optional. To enable them assign any value -to the respective variable. Example: > +(including zero) to the respective variable. Example: > :let c_comment_strings = 1 -To disable them use ":unlet". Example: > + :let c_no_bracket_error = 0 +To disable them use `:unlet`. Example: > :unlet c_comment_strings +Setting the value to zero doesn't work! An alternative is to switch to the C++ highlighting: > :set filetype=cpp @@ -955,8 +987,8 @@ Variable Highlight ~ except { and } in first column Default is to highlight them, otherwise you can't spot a missing ")". -*c_curly_error* highlight a missing }; this forces syncing from the - start of the file, can be slow +*c_curly_error* highlight a missing } by finding all pairs; this + forces syncing from the start of the file, can be slow *c_no_ansi* don't do standard ANSI types and constants *c_ansi_typedefs* ... but do standard ANSI types *c_ansi_constants* ... but do standard ANSI constants @@ -1369,26 +1401,26 @@ to your startup file. EUPHORIA *euphoria3.vim* *euphoria4.vim* *ft-euphoria-syntax* -Two syntax highlighting files exists for Euphoria. One for Euphoria -version 3.1.1, which is the default syntax highlighting file, and one for +Two syntax highlighting files exists for Euphoria. One for Euphoria +version 3.1.1, which is the default syntax highlighting file, and one for Euphoria version 4.0.5 or later. -Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary -for developing applications for the DOS platform, which Euphoria version 4 +Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary +for developing applications for the DOS platform, which Euphoria version 4 (http://www.openeuphoria.org/) does not support. -The following file extensions are auto-detected as Euphoria file type: - +The following file extensions are auto-detected as Euphoria file type: + *.e, *.eu, *.ew, *.ex, *.exu, *.exw *.E, *.EU, *.EW, *.EX, *.EXU, *.EXW -To select syntax highlighting file for Euphoria, as well as for +To select syntax highlighting file for Euphoria, as well as for auto-detecting the *.e and *.E file extensions as Euphoria file type, add the following line to your startup file: > :let filetype_euphoria="euphoria3" - or + or :let filetype_euphoria="euphoria4" @@ -2729,6 +2761,13 @@ This will add highlighting for the commands that BASH (version 2.05a and later, and part earlier) adds. +REGO *rego.vim* *ft-rego-syntax* + +Rego is a query language developed by Styra. It is mostly used as a policy +language for kubernetes, but can be applied to almost anything. Files with +the following extensions are recognized as rego files: .rego. + + RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax* Syntax highlighting is enabled for code blocks within the document for a @@ -2741,10 +2780,10 @@ To set a user-defined list of code block syntax highlighting: > To assign multiple code block types to a single syntax, define `rst_syntax_code_list` as a mapping: > let rst_syntax_code_list = { - \ 'cpp' = ['cpp', 'c++'], - \ 'bash' = ['bash', 'sh'], + \ 'cpp': ['cpp', 'c++'], + \ 'bash': ['bash', 'sh'], ... - } + \ } To use color highlighting for emphasis text: > let rst_use_emphasis_colors = 1 @@ -3505,26 +3544,26 @@ It will look much better with a font in a quadratic cell size, e.g. for X: > YAML *yaml.vim* *ft-yaml-syntax* *g:yaml_schema* *b:yaml_schema* -A YAML schema is a combination of a set of tags and a mechanism for resolving -non-specific tags. For user this means that YAML parser may, depending on -plain scalar contents, treat plain scalar (which can actually be only string -and nothing else) as a value of the other type: null, boolean, floating-point, -integer. `g:yaml_schema` option determines according to which schema values +A YAML schema is a combination of a set of tags and a mechanism for resolving +non-specific tags. For user this means that YAML parser may, depending on +plain scalar contents, treat plain scalar (which can actually be only string +and nothing else) as a value of the other type: null, boolean, floating-point, +integer. `g:yaml_schema` option determines according to which schema values will be highlighted specially. Supported schemas are Schema Description ~ failsafe No additional highlighting. json Supports JSON-style numbers, booleans and null. core Supports more number, boolean and null styles. -pyyaml In addition to core schema supports highlighting timestamps, - but there are some differences in what is recognized as - numbers and many additional boolean values not present in core +pyyaml In addition to core schema supports highlighting timestamps, + but there are some differences in what is recognized as + numbers and many additional boolean values not present in core schema. Default schema is `core`. -Note that schemas are not actually limited to plain scalars, but this is the -only difference between schemas defined in YAML specification and the only +Note that schemas are not actually limited to plain scalars, but this is the +only difference between schemas defined in YAML specification and the only difference defined in the syntax file. @@ -3626,7 +3665,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword* clear: Syntax specific iskeyword setting is disabled and the buffer-local 'iskeyword' setting is used. - {option} Set the syntax 'iskeyword' option to a new value. + {option} Set the syntax 'iskeyword' option to a new value. Example: > :syntax iskeyword @,48-57,192-255,$,_