Skip to content

Commit 6b519e9

Browse files
authored
Merge pull request #2474 from h-east/update-syntax
Update syntax.{txt,jax}
2 parents 836c367 + 9c73155 commit 6b519e9

2 files changed

Lines changed: 75 additions & 71 deletions

File tree

doc/syntax.jax

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim バージョン 9.1. Last change: 2026 Jan 06
1+
*syntax.txt* For Vim バージョン 9.1. Last change: 2026 Jan 23
22

33

44
VIM リファレンスマニュアル by Bram Moolenaar
@@ -2630,47 +2630,51 @@ ncf.vimによって認識されない文をエラーとしてハイライトさ
26302630

26312631
NROFF *nroff.vim* *ft-nroff-syntax*
26322632

2633-
nroff構文ファイルはそのままでAT&T n/troffに対応している。構文ファイルに含まれ
2634-
ているGNU groff拡張機能を使うには、それを有効化する必要がある。
2635-
2636-
例えば、LinuxとBSDディストリビューションは、デフォルトではテキスト処理パッケー
2637-
ジとしてgroffを使う。groff用の拡張構文ハイライト機能を有効化するには、ファイル
2638-
を groff (|ft-groff-syntax| を参照)として認識されるように調整する、あるいは次
2639-
のオプションを初期化ファイルに加える: >
2633+
nroff 構文ファイルは、AT&T n/troff でそのまま使用できる。Linux および BSD ディ
2634+
ストリビューションがデフォルトの組版パッケージとして使用している GNU troff
2635+
(groff) をサポートするには、ファイルを groff の入力として認識させるか
2636+
(|ft-groff-syntax| を参照)、スタートアップファイルに以下のオプションを追加す
2637+
る: >
26402638
26412639
:let nroff_is_groff = 1
26422640
2643-
groffは、Solarisでまだ使われているかもしれない古いAT&T n/troffとは異なる。
2644-
groffのマクロとリクエスト名は2文字以上の長さであってもよく、言語プリミティブに
2645-
拡張がされている。例えば、AT&T troffではリクエスト\(yrを使い、2桁の数で年にア
2646-
クセスする。groffでは互換性のために同じリクエストを使うこともできるし、または
2647-
groffネイティブの構文,\[yr]を使うこともできる。さらに、\[year]として4桁の年を
2648-
直接使うこともできる。マクロリクエストは2文字以上の長さであってもよい。例えば、
2649-
GNU mmはverbatim環境を作るのに ".VERBON" と ".VERBOFF" というリクエストを受け
2650-
つける。
2641+
GNU troff は、*roff 言語構文を拡張することで、古い AT&T n/troff プログラム
2642+
(Solaris や Plan 9 にまだ残っているかもしれない) とは異なる。例えば、AT&T
2643+
troff では、1900 年からの年数にはエスケープシーケンス \(yr でアクセスする。
2644+
groff でも同様にエスケープシーケンス \(yr を使用してアクセスでき、互換性のため
2645+
に認識される。あるいは、groff の拡張構文 \[yr] を使用できる。AT&T troff では、
2646+
yr レジスタは "現在の年の下 2 桁" を格納すると説明されていたが、Y2K 問題があっ
2647+
た。groff では、\[year] でグレゴリオ暦の年を正しくアクセスできる。groff では、
2648+
フォント名、レジスタ名、マクロ名、文字列名、リクエスト名は 2 文字を超えること
2649+
ができる。例えば、groff の mm パッケージでは、制御行 ".VERBON" と".VERBOFF"
2650+
は、これらの名前のマクロを呼び出して、"verbatim" な内容の表示を囲む。
26512651

26522652
g/troffによって得られる最良の整形された出力を得るには、スペースと句読点に関す
26532653
るいくつかの単純なルールに従うべきである。
26542654

2655-
1. 行の末尾に空のスペースを置かないこと
2656-
2657-
2. 文末のピリオド、エクスクラメーションマークなどの後にはちょうど1個のスペース
2658-
を置くこと。
2655+
1. 各文の末尾で改行 (キャリッジリターン) すること。改行の前にスペースを入れな
2656+
いこと。
26592657

2660-
3. 後述の理由により、全てのピリオドの後に改行(carriage return)を置くとよい。
2658+
2. 行末にピリオド、疑問符、感嘆符があり、それらが文の終わりを意味しない場合は、
2659+
ダミー文字のエスケープシーケンス \& を続けて使用すること。
26612660

2662-
これらの妙なtipsの理由は、g/n/troffが改行に、これらのルールに従わないとすぐに
2663-
混乱してしまうアルゴリズムを使っているためである
2661+
3. マクロパッケージを使用している場合は、段落分けマクロを使用して段落のインデ
2662+
ントと段落間のスペースを確保すること
26642663

2664+
4. 文書の保守を容易にするため、空リクエスト (行に '.' のみ) を自由に使用して、
2665+
視覚的に要素を区切ること。
26652666

2666-
troffはTeXと違い、段落ごとでなく行ごとにテキストを書き込む。さらに、glueや
2667-
stretchの概念を持たず、入力に水平、垂直の空白があると全てそのまま出力される。
2667+
これらのヒントの理由は、g/n/troff が文末を検出し、その情報を用いて文間スペース
2668+
を適用できるためである。また、これらのヒントを使用すると、テキストエディタでの
2669+
再入力によってのみ行が変更される diff のサイズも最小限に抑えられる。マクロパッ
2670+
ケージは通常、段落間のスペースとして 1 つの V 字 (入力行が空白の場合に発生する)
2671+
以外の値を使用し、そのスペース値と段落のインデントをユーザーが設定可能なレジス
2672+
タに保存することで、ページのレイアウトを一定に保つ。
26682673

2669-
それゆえ、最終的なドキュメントで意図する以上の空白を文と文の間にはさまないよう
2670-
に注意すること。この理由のため、全ての句読点記号の後すぐに改行を入れるという習
2671-
慣がある。最終的に処理された出力が「一様な」テキストになってほしければ、入力の
2672-
テキストで正しくスペースを置いておく必要がある。行末の空白と句読点の後の2個以
2673-
上の空白をエラーとしてハイライトしたいならこうする: >
2674+
TeX とは異なり、troff は段落ごとではなく行ごとにテキストを埋め込む。フォーマッ
2675+
トされた出力で単語間および文間のスペースを一定に保ちたい場合は、入力テキストの
2676+
スペースも一定に保つ必要がある。末尾のスペースと句読点の後の 2 つ以上のスペー
2677+
スの両方をエラーとしてマークするには、以下のようにする: >
26742678
26752679
:let nroff_space_errors = 1
26762680
@@ -2687,11 +2691,11 @@ stretchの概念を持たず、入力に水平、垂直の空白があると全
26872691
26882692
let b:preprocs_as_sections = 1
26892693
2690-
同様に、構文ファイルはmsパッケージ中の拡張段落マクロ(.XP)用の余分な段落マーカー
2691-
も含んでいる
2694+
さらに、この構文ファイルは、ms パッケージの XP 段落マクロ (Berkeley および GNU
2695+
の拡張機能) 用の段落マーカーを追加する
26922696

2693-
最後に、構文ファイル|groff.vim|が存在する。これはデフォルトでfile basisとグ
2694-
ローバルの両方でgroff構文ハイライトすることができる
2697+
最後に、groff 構文のハイライトをファイルごとに、またはデフォルトでグローバルに
2698+
有効にするために使用できる |groff.vim| 構文ファイルがある
26952699

26962700

26972701
OCAML *ocaml.vim* *ft-ocaml-syntax*

en/syntax.txt

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 9.1. Last change: 2026 Jan 06
1+
*syntax.txt* For Vim version 9.1. Last change: 2026 Jan 23
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2702,50 +2702,50 @@ If you don't want to highlight these errors, leave it unset.
27022702

27032703
NROFF *nroff.vim* *ft-nroff-syntax*
27042704

2705-
The nroff syntax file works with AT&T n/troff out of the box. You need to
2706-
activate the GNU groff extra features included in the syntax file before you
2707-
can use them.
2708-
2709-
For example, Linux and BSD distributions use groff as their default text
2710-
processing package. In order to activate the extra syntax highlighting
2711-
features for groff, arrange for files to be recognized as groff (see
2705+
The nroff syntax file works with AT&T n/troff as-is. To support GNU troff
2706+
(groff), which Linux and BSD distributions use as their default typesetting
2707+
package, arrange for files to be recognized as groff input (see
27122708
|ft-groff-syntax|) or add the following option to your start-up files: >
27132709
27142710
:let nroff_is_groff = 1
27152711
2716-
Groff is different from the old AT&T n/troff that you may still find in
2717-
Solaris. Groff macro and request names can be longer than 2 characters and
2718-
there are extensions to the language primitives. For example, in AT&T troff
2719-
you access the year as a 2-digit number with the request \(yr. In groff you
2720-
can use the same request, recognized for compatibility, or you can use groff's
2721-
native syntax, \[yr]. Furthermore, you can use a 4-digit year directly:
2722-
\[year]. Macro requests can be longer than 2 characters, for example, GNU mm
2723-
accepts the requests ".VERBON" and ".VERBOFF" for creating verbatim
2724-
environments.
2712+
GNU troff differs from older AT&T n/troff programs (that you may still find in
2713+
Solaris or Plan 9) by extending the *roff language syntax. For example, in
2714+
AT&T troff, you access the count of years since 1900 with the escape sequence
2715+
\(yr. In groff you can do the same, which it recognizes for compatibility, or
2716+
use groff's extended syntax, \[yr]. AT&T troff documented the yr register as
2717+
storing the "last two digits of current year", but had a Y2K problem; in
2718+
groff, you can access the Gregorian year correctly: \[year]. In groff, font,
2719+
register, macro, string, and request names can exceed two characters; for
2720+
example, with groff's mm package, the control lines ".VERBON" and ".VERBOFF"
2721+
call macros of those names to bracket displays of "verbatim" content.
27252722

27262723
In order to obtain the best formatted output g/troff can give you, you should
27272724
follow a few simple rules about spacing and punctuation.
27282725

2729-
1. Do not leave empty spaces at the end of lines.
2726+
1. Break the line (put a carriage return) at the end of every sentence. Don't
2727+
permit trailing spaces before the newline.
27302728

2731-
2. Leave one space and one space only after an end-of-sentence period,
2732-
exclamation mark, etc.
2729+
2. If a line ends with a period, question mark, or exclamation point that does
2730+
not end a sentence, follow it with the dummy character escape sequence \&.
27332731

2734-
3. For reasons stated below, it is best to follow all period marks with a
2735-
carriage return.
2732+
3. If you're using a macro package, employ its paragraphing macros to achieve
2733+
indentation of paragraphs and spacing between them.
27362734

2737-
The reason behind these unusual tips is that g/n/troff have a line breaking
2738-
algorithm that can be easily upset if you don't follow the rules given above.
2735+
4. Use the empty request, a '.' on a line by itself, freely to visually
2736+
separate material for ease of document maintenance.
27392737

2740-
Unlike TeX, troff fills text line-by-line, not paragraph-by-paragraph and,
2741-
furthermore, it does not have a concept of glue or stretch, all horizontal and
2742-
vertical space input will be output as is.
2738+
The reason for these tips is that g/n/troff attempts to detect the ends of
2739+
sentences, and can use that information to apply inter-sentence space. Using
2740+
them also minimizes the size of diffs where lines change due only to refilling
2741+
in the text editor. Macro packages typically employ inter-paragraph spacing
2742+
amounts other than one vee (which is the result of a blank input line), and
2743+
typically store that spacing amount, and that of paragraph indentation, in
2744+
user-configurable registers so that pages lay out consistently.
27432745

2744-
Therefore, you should be careful about not using more space between sentences
2745-
than you intend to have in your final document. For this reason, the common
2746-
practice is to insert a carriage return immediately after all punctuation
2747-
marks. If you want to have "even" text in your final processed output, you
2748-
need to maintain regular spacing in the input text. To mark both trailing
2746+
Unlike TeX, troff fills text line-by-line, not paragraph-by-paragraph. If you
2747+
desire consistent spacing between words and sentences in formatted output, you
2748+
must maintain consistent spacing in the input text. To mark both trailing
27492749
spaces and two or more spaces after a punctuation as an error, use: >
27502750
27512751
:let nroff_space_errors = 1
@@ -2765,11 +2765,11 @@ file: >
27652765
27662766
let b:preprocs_as_sections = 1
27672767
2768-
As well, the syntax file adds an extra paragraph marker for the extended
2769-
paragraph macro (.XP) in the ms package.
2768+
Further, the syntax file adds an extra paragraph marker for the XP
2769+
paragraphing macro in the ms package, a Berkeley and GNU extension.
27702770

2771-
Finally, there is a |groff.vim| syntax file that can be used for enabling
2772-
groff syntax highlighting either on a file basis or globally by default.
2771+
Finally, there is a |groff.vim| syntax file that can be used to enable groff
2772+
syntax highlighting either on a per-file basis or globally by default.
27732773

27742774

27752775
OCAML *ocaml.vim* *ft-ocaml-syntax*
@@ -4699,7 +4699,7 @@ the region, but not the contents of the region, are marked as concealable.
46994699
Whether or not they are actually concealed depends on the setting on the
47004700
'conceallevel' option. The ends of a region can only be concealed separately
47014701
in this way when they have their own highlighting via "matchgroup". The
4702-
|synconcealed()| function can be used to retrieve information about conealed
4702+
|synconcealed()| function can be used to retrieve information about concealed
47034703
items.
47044704

47054705
cchar *:syn-cchar*

0 commit comments

Comments
 (0)