Skip to content

Commit bce3925

Browse files
authored
Merge pull request #749 from tennashi/update_syntax
Update syntax.{txt,jax}
2 parents 76af8d8 + f8492ec commit bce3925

File tree

2 files changed

+143
-65
lines changed

2 files changed

+143
-65
lines changed

doc/syntax.jax

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim バージョン 8.1. Last change: 2019 Oct 27
1+
*syntax.txt* For Vim バージョン 8.2. Last change: 2019 Dec 19
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -465,6 +465,15 @@ Note -s フラグは .vimrc とプラグインの読み込みを抑制する。
465465
ようなことがらをすべてスクリプトファイルに書き込み、-u フラグで読み込んで実行
466466
するといいだろう。
467467

468+
*hl-TOhtmlProgress* *TOhtml-progress-color*
469+
プログレスバーは HTML 変換が進むにつれ、ステータスラインに沿って色付きの四角で
470+
表示される。デフォルトでは背景色は現在の "DiffDelete" ハイライトグループの設定
471+
が適用される。"DiffDelete" と "StatusLine" の背景色が同じ場合、TOhtml は自動で
472+
色を調整する。自動で色を選択したくない場合は、自身でプログレスバーのハイライト
473+
色を定義することができる。例えば: >
474+
475+
hi TOhtmlProgress guifg=#c0ffee ctermbg=7
476+
<
468477
*g:html_number_lines*
469478
初期設定: 現在の 'number' の設定
470479
0 なら、バッファのテキストは行番号なしで HTML に表示される。
@@ -496,8 +505,8 @@ Javascript が挿入される (|g:html_dynamic_folds|)。javascript はウィン
496505
<
497506
*g:html_use_css*
498507
初期設定: 1
499-
1 なら、CSS1 で装飾された HTML 4.01 準拠の HTML が生成される。最新のブラウザー
500-
とほとんどの古いブラウザーでサポートされている
508+
1 なら、CSS で装飾された HTML 5 準拠の HTML が生成される。最新のブラウザーと多
509+
くの古いブラウザーでサポートされている
501510
0 なら、<font> タグで装飾された時代遅れの HTML が生成される。これは推奨されて
502511
いないが、古いブラウザー、あるいはメーラーや掲示板の投稿など、CSS が使えない場
503512
合には必要だろう。
@@ -567,20 +576,40 @@ CSS を使うようになる。
567576
例えば、foldcolumn と行番号をコピーできないようにするには: >
568577
:let g:html_prevent_copy = "fn"
569578
<
570-
この機能は現在、コピー抑制エリアに読み込み専用の <input> 要素を挿入することで
571-
実装されている。これはすべての場合で機能するわけではない。他の、HTML を解釈す
572-
るアプリケーションにペーストすると、<input> 要素もペーストされる。しかしプレー
573-
ンテキストとしてのペーストなら常に機能するだろう。
579+
生成されたページのコピーを防ぐための方法は |g:html_use_input_for_pc| の値に依
580+
存している。
581+
582+
*g:html_use_input_for_pc*
583+
初期設定: "fallback"
584+
|g:html_prevent_copy| の値が空文字列でないとき:
585+
586+
"all" なら、コピー抑制エリアにある通常テキストの代わりに読み込み専用の <input>
587+
要素を使用する。古いブラウザーなどいくつかのブラウザーでは、ページ全体を選択し
588+
コピーした後、<input> タグはページテキストと共にペーストされない。もし
589+
|g:html_no_invalid| が 0 ならば、<input> タグは不正な属性を持つ。これにより大
590+
抵のブラウザーで機能するようになるが、ページは正しくない。
591+
Note: この方法は最近の Chrome やそれと同等なブラウザーでは動作しない。<input>
592+
タグはテキストと共にペーストされてしまう。
593+
594+
"fallback" なら (これは初期設定値である)、古いブラウザーのために同様に <input>
595+
要素を生成するが、コピー抑制テキストを表示するために新しいブラウザー (これは
596+
CSS 機能クエリで決定される) では <input> 要素を隠し、::before 疑似要素で生成し
597+
たコンテンツを代わりに使用する。この方法は新旧ほとんどのブラウザーで機能する。
598+
599+
"none" なら <input> 要素は生成されない。コンテンツを生成する方法のみが使用され
600+
る。これは Internet Explorer のような古いブラウザーでは、コピーできないように
601+
意図されたテキストがコピーできるか、コピー抑制テキストが全く表示されないことを
602+
意味する。ただし、これが最も標準的な方法でマークアップも少なくなる。
574603

575604
*g:html_no_invalid*
576605
初期設定: 0
577-
0 なら、もし |g:html_prevent_copy| が空でなければ、コピー抑制エリアのための
578-
<input> エレメントに不正な属性が意図的に挿入される。これによって、<input> 要素
579-
がペーストされてしまうような場合でもいくつかのアプリケーションは対応可能とな
580-
。特に、Microsoft Word は不正な属性を持つ <input> 要素をペーストしない。
581-
1 なら、不正な属性は挿入されない。正しいページが生成される。ただ
582-
し、|g:html_prevent_copy| が空でないときに、Microsoft Word にペーストするには
583-
注意が必要である。<input> 要素がペーストされないようにするのは困難だ
606+
0 なら、もし |g:html_prevent_copy| が空でなく |g:html_use_input_for_pc|
607+
"none" でない場合、コピー抑制エリアのための <input> エレメントに不正な属性が意
608+
図的に挿入される。これによって、いくつかのアプリケーションで <input> 要素がペー
609+
ストされることを防ぐ。特に、いくつかのバージョンの Microsoft Word では不正な属
610+
性を持つ <input> 要素をペーストしない。1 なら、不正な属性は挿入されない。正し
611+
いページが生成される。ただし、いくつかのアプリケーションでは <input> 要素はペー
612+
ストされてしまい、後で削除するのが困難になる
584613

585614
*g:html_hover_unfold*
586615
初期設定: 0
@@ -910,10 +939,12 @@ Basicとして扱われる。
910939
C *c.vim* *ft-c-syntax*
911940

912941
Cには幾つかの補助的なハイライト方法がある。それらを有効化するには対応した変数
913-
に値を設定する。例: >
942+
に値 (0 を含む) を設定する。例: >
914943
:let c_comment_strings = 1
915-
これを無効化するには ":unlet" を使う。例: >
944+
:let c_no_bracket_error = 0
945+
これを無効化するには `:unlet` を使う。例: >
916946
:unlet c_comment_strings
947+
0 に変更しても無効化されない!
917948

918949
代わりに、C++ のハイライトに切り替える方法もある: >
919950
:set filetype=cpp
@@ -929,8 +960,9 @@ Cには幾つかの補助的なハイライト方法がある。それらを有
929960
をエラーとして表示しない。
930961
デフォルトでエラーとして表示される。欠落した
931962
")" を見つけられないため。
932-
*c_curly_error* 対応する { がない } をハイライトする。これを有効にする
933-
と、ファイルの先頭から同期が始まるため、遅くなる
963+
*c_curly_error* 全てのペアを検証することにより対応する { がない } をハ
964+
イライトする。これを有効にすると、ファイルの先頭から同
965+
期が 始まるため、遅くなる
934966
*c_no_ansi* ANSI標準の型と定数をハイライトしない
935967
*c_ansi_typedefs* ... 但し標準ANSI型はハイライトする
936968
*c_ansi_constants* ... 但し標準ANSI定数はハイライトする
@@ -2631,6 +2663,13 @@ readlineライブラリは主としてBASHシェルで使われ、BASHはかな
26312663
トするようになる。
26322664

26332665

2666+
REGO *rego.vim* *ft-rego-syntax*
2667+
2668+
Rego は Styra が開発したクエリ言語である。主に kubernetes のポリシー言語として
2669+
使用されるが、ほぼ全てのアプリケーションに適用できる。次の拡張子のファイルが
2670+
rego ファイルとして認識される: .rego
2671+
2672+
26342673
RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax*
26352674

26362675
選択したファイルタイプの数について、文書内のコードブロックに対して構文ハイライ
@@ -2643,10 +2682,10 @@ RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax*
26432682
複数のコードブロックタイプを単一の構文に割り当てるには、マッピングとして
26442683
`rst_syntax_code_list` を定義する: >
26452684
let rst_syntax_code_list = {
2646-
\ 'cpp' = ['cpp', 'c++'],
2647-
\ 'bash' = ['bash', 'sh'],
2685+
\ 'cpp': ['cpp', 'c++'],
2686+
\ 'bash': ['bash', 'sh'],
26482687
...
2649-
}
2688+
\ }
26502689
26512690
強調テキストにカラーハイライトを使用するには: >
26522691
let rst_use_emphasis_colors = 1
@@ -4679,7 +4718,7 @@ cterm={attr-list} *highlight-cterm*
46794718
メントを青色で表示することができる。
46804719
Note: DOSコンソールなどいくつかのターミナルでは色づけの際にこれらの属
46814720
性を混在させることはできない。移植性を重視するには、"cterm=" か
4682-
"ctermfg=" "ctermbg=" のどれか1つだけを使うこと。
4721+
"ctermfg=" "ctermbg=" のどれか1つだけを使うこと。
46834722

46844723
ctermfg={color-nr} *highlight-ctermfg* *E421*
46854724
ctermbg={color-nr} *highlight-ctermbg*

en/syntax.txt

Lines changed: 82 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 8.1. Last change: 2019 Oct 27
1+
*syntax.txt* For Vim version 8.2. Last change: 2019 Dec 19
22

33

44
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
476476
script to replace all the -c commands and use it with the -u flag instead of
477477
specifying each command separately.
478478

479+
*hl-TOhtmlProgress* *TOhtml-progress-color*
480+
When displayed, the progress bar will show colored boxes along the statusline
481+
as the HTML conversion proceeds. By default, the background color as the
482+
current "DiffDelete" highlight group is used. If "DiffDelete" and "StatusLine"
483+
have the same background color, TOhtml will automatically adjust the color to
484+
differ. If you do not like the automatically selected colors, you can define
485+
your own highlight colors for the progress bar. Example: >
486+
487+
hi TOhtmlProgress guifg=#c0ffee ctermbg=7
488+
<
479489
*g:html_number_lines*
480490
Default: current 'number' setting.
481491
When 0, buffer text is displayed in the generated HTML without line numbering.
@@ -507,8 +517,8 @@ For example: >
507517
<
508518
*g:html_use_css*
509519
Default: 1.
510-
When 1, generate valid HTML 4.01 markup with CSS1 styling, supported in all
511-
modern browsers and most old browsers.
520+
When 1, generate valid HTML 5 markup with CSS styling, supported in all modern
521+
browsers and many old browsers.
512522
When 0, generate <font> tags and similar outdated markup. This is not
513523
recommended but it may work better in really old browsers, email clients,
514524
forum posts, and similar situations where basic CSS support is unavailable.
@@ -580,23 +590,43 @@ affected in this way as follows:
580590
Example, to make the fold column and line numbers uncopyable: >
581591
:let g:html_prevent_copy = "fn"
582592
<
583-
This feature is currently implemented by inserting read-only <input> elements
584-
into the markup to contain the uncopyable areas. This does not work well in
585-
all cases. When pasting to some applications which understand HTML, the
586-
<input> elements also get pasted. But plain-text paste destinations should
587-
always work.
593+
The method used to prevent copying in the generated page depends on the value
594+
of |g:html_use_input_for_pc|.
595+
596+
*g:html_use_input_for_pc*
597+
Default: "fallback"
598+
If |g:html_prevent_copy| is non-empty, then:
599+
600+
When "all", read-only <input> elements are used in place of normal text for
601+
uncopyable regions. In some browsers, especially older browsers, after
602+
selecting an entire page and copying the selection, the <input> tags are not
603+
pasted with the page text. If |g:html_no_invalid| is 0, the <input> tags have
604+
invalid type; this works in more browsers, but the page will not validate.
605+
Note: this method does NOT work in recent versions of Chrome and equivalent
606+
browsers; the <input> tags get pasted with the text.
607+
608+
When "fallback" (default value), the same <input> elements are generated for
609+
older browsers, but newer browsers (detected by CSS feature query) hide the
610+
<input> elements and instead use generated content in an ::before pseudoelement
611+
to display the uncopyable text. This method should work with the largest
612+
number of browsers, both old and new.
613+
614+
When "none", the <input> elements are not generated at all. Only the
615+
generated-content method is used. This means that old browsers, notably
616+
Internet Explorer, will either copy the text intended not to be copyable, or
617+
the non-copyable text may not appear at all. However, this is the most
618+
standards-based method, and there will be much less markup.
588619

589620
*g:html_no_invalid*
590621
Default: 0.
591-
When 0, if |g:html_prevent_copy| is non-empty, an invalid attribute is
592-
intentionally inserted into the <input> element for the uncopyable areas. This
593-
increases the number of applications you can paste to without also pasting the
594-
<input> elements. Specifically, Microsoft Word will not paste the <input>
595-
elements if they contain this invalid attribute.
596-
When 1, no invalid markup is ever intentionally inserted, and the generated
597-
page should validate. However, be careful pasting into Microsoft Word when
598-
|g:html_prevent_copy| is non-empty; it can be hard to get rid of the <input>
599-
elements which get pasted.
622+
When 0, if |g:html_prevent_copy| is non-empty and |g:html_use_input_for_pc| is
623+
not "none", an invalid attribute is intentionally inserted into the <input>
624+
element for the uncopyable areas. This prevents pasting the <input> elements
625+
in some applications. Specifically, some versions of Microsoft Word will not
626+
paste the <input> elements if they contain this invalid attribute. When 1, no
627+
invalid markup is inserted, and the generated page should validate. However,
628+
<input> elements may be pasted into some applications and can be difficult to
629+
remove afterward.
600630

601631
*g:html_hover_unfold*
602632
Default: 0.
@@ -936,10 +966,12 @@ Basic.
936966
C *c.vim* *ft-c-syntax*
937967

938968
A few things in C highlighting are optional. To enable them assign any value
939-
to the respective variable. Example: >
969+
(including zero) to the respective variable. Example: >
940970
:let c_comment_strings = 1
941-
To disable them use ":unlet". Example: >
971+
:let c_no_bracket_error = 0
972+
To disable them use `:unlet`. Example: >
942973
:unlet c_comment_strings
974+
Setting the value to zero doesn't work!
943975

944976
An alternative is to switch to the C++ highlighting: >
945977
:set filetype=cpp
@@ -955,8 +987,8 @@ Variable Highlight ~
955987
except { and } in first column
956988
Default is to highlight them, otherwise you
957989
can't spot a missing ")".
958-
*c_curly_error* highlight a missing }; this forces syncing from the
959-
start of the file, can be slow
990+
*c_curly_error* highlight a missing } by finding all pairs; this
991+
forces syncing from the start of the file, can be slow
960992
*c_no_ansi* don't do standard ANSI types and constants
961993
*c_ansi_typedefs* ... but do standard ANSI types
962994
*c_ansi_constants* ... but do standard ANSI constants
@@ -1369,26 +1401,26 @@ to your startup file.
13691401

13701402
EUPHORIA *euphoria3.vim* *euphoria4.vim* *ft-euphoria-syntax*
13711403

1372-
Two syntax highlighting files exists for Euphoria. One for Euphoria
1373-
version 3.1.1, which is the default syntax highlighting file, and one for
1404+
Two syntax highlighting files exists for Euphoria. One for Euphoria
1405+
version 3.1.1, which is the default syntax highlighting file, and one for
13741406
Euphoria version 4.0.5 or later.
13751407

1376-
Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary
1377-
for developing applications for the DOS platform, which Euphoria version 4
1408+
Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary
1409+
for developing applications for the DOS platform, which Euphoria version 4
13781410
(http://www.openeuphoria.org/) does not support.
13791411

1380-
The following file extensions are auto-detected as Euphoria file type:
1381-
1412+
The following file extensions are auto-detected as Euphoria file type:
1413+
13821414
*.e, *.eu, *.ew, *.ex, *.exu, *.exw
13831415
*.E, *.EU, *.EW, *.EX, *.EXU, *.EXW
13841416

1385-
To select syntax highlighting file for Euphoria, as well as for
1417+
To select syntax highlighting file for Euphoria, as well as for
13861418
auto-detecting the *.e and *.E file extensions as Euphoria file type,
13871419
add the following line to your startup file: >
13881420
13891421
:let filetype_euphoria="euphoria3"
13901422
1391-
or
1423+
or
13921424
13931425
:let filetype_euphoria="euphoria4"
13941426
@@ -2729,6 +2761,13 @@ This will add highlighting for the commands that BASH (version 2.05a and
27292761
later, and part earlier) adds.
27302762

27312763

2764+
REGO *rego.vim* *ft-rego-syntax*
2765+
2766+
Rego is a query language developed by Styra. It is mostly used as a policy
2767+
language for kubernetes, but can be applied to almost anything. Files with
2768+
the following extensions are recognized as rego files: .rego.
2769+
2770+
27322771
RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax*
27332772

27342773
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: >
27412780
To assign multiple code block types to a single syntax, define
27422781
`rst_syntax_code_list` as a mapping: >
27432782
let rst_syntax_code_list = {
2744-
\ 'cpp' = ['cpp', 'c++'],
2745-
\ 'bash' = ['bash', 'sh'],
2783+
\ 'cpp': ['cpp', 'c++'],
2784+
\ 'bash': ['bash', 'sh'],
27462785
...
2747-
}
2786+
\ }
27482787
27492788
To use color highlighting for emphasis text: >
27502789
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: >
35053544
YAML *yaml.vim* *ft-yaml-syntax*
35063545

35073546
*g:yaml_schema* *b:yaml_schema*
3508-
A YAML schema is a combination of a set of tags and a mechanism for resolving
3509-
non-specific tags. For user this means that YAML parser may, depending on
3510-
plain scalar contents, treat plain scalar (which can actually be only string
3511-
and nothing else) as a value of the other type: null, boolean, floating-point,
3512-
integer. `g:yaml_schema` option determines according to which schema values
3547+
A YAML schema is a combination of a set of tags and a mechanism for resolving
3548+
non-specific tags. For user this means that YAML parser may, depending on
3549+
plain scalar contents, treat plain scalar (which can actually be only string
3550+
and nothing else) as a value of the other type: null, boolean, floating-point,
3551+
integer. `g:yaml_schema` option determines according to which schema values
35133552
will be highlighted specially. Supported schemas are
35143553

35153554
Schema Description ~
35163555
failsafe No additional highlighting.
35173556
json Supports JSON-style numbers, booleans and null.
35183557
core Supports more number, boolean and null styles.
3519-
pyyaml In addition to core schema supports highlighting timestamps,
3520-
but there are some differences in what is recognized as
3521-
numbers and many additional boolean values not present in core
3558+
pyyaml In addition to core schema supports highlighting timestamps,
3559+
but there are some differences in what is recognized as
3560+
numbers and many additional boolean values not present in core
35223561
schema.
35233562

35243563
Default schema is `core`.
35253564

3526-
Note that schemas are not actually limited to plain scalars, but this is the
3527-
only difference between schemas defined in YAML specification and the only
3565+
Note that schemas are not actually limited to plain scalars, but this is the
3566+
only difference between schemas defined in YAML specification and the only
35283567
difference defined in the syntax file.
35293568

35303569

@@ -3626,7 +3665,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
36263665

36273666
clear: Syntax specific iskeyword setting is disabled and the
36283667
buffer-local 'iskeyword' setting is used.
3629-
{option} Set the syntax 'iskeyword' option to a new value.
3668+
{option} Set the syntax 'iskeyword' option to a new value.
36303669

36313670
Example: >
36323671
:syntax iskeyword @,48-57,192-255,$,_

0 commit comments

Comments
 (0)