Skip to content

Update syntax.{txt,jax} #2061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions doc/syntax.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Apr 15
*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Apr 28


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -1037,8 +1037,13 @@ Cには幾つかの補助的なハイライト方法がある。それらを有
*c_ansi_typedefs* ... 但し標準ANSI型はハイライトする
*c_ansi_constants* ... 但し標準ANSI定数はハイライトする
*c_no_utf* 文字列中の\uと\Uをハイライトしない
*c_syntax_for_h* ファイル *.h に C++ ではなく C の構文を適用し、
objcpp ではなく objc の構文を適用する。
*c_syntax_for_h* *.h ファイルには C++/ObjC/ObjC++ ではなく C の構文を使
用する
(NOTE: この変数は非推奨であり現在は不要である。*.h ファ
イルは、C++ やObjective-C の構文が含まれていない限り、
デフォルトで C として扱われる。自動検出が失敗した場合
は、`g:filetype_h` を使ってデフォルトのファイルタイプ
を調整できる。)
*c_no_if0* "#if 0" のブロックをコメントとしてハイライトしない
*c_no_cformat* 文字列中の "%" によるフォーマットをハイライトしない
*c_no_c99* C99の標準アイテムをハイライトしない
Expand Down Expand Up @@ -1097,6 +1102,10 @@ C/C++ インタープリター。Ch は C に似た構文ハイライトを持

変数を設定すれば、*.h ファイルに対して C, C++ でなく Ch の構文を使うようにする
ことができる: >
:let g:filetype_h = 'ch'

NOTE: Vim の以前のバージョンでは、以下の (現在は非推奨の) 変数が使用されていた
が、現在は推奨される方法ではない: >
:let ch_syntax_for_h = 1


Expand Down Expand Up @@ -2107,6 +2116,13 @@ Note これら 3 つの変数は HTML 構文ファイルで維持されること
合は 1 行目の内容を表示するように以下で選択できる >
:let g:java_foldtext_show_first_or_second_line = 1

Javadoc コメント内の HTML タグは、|html-folding| に記載されている指示に従い、
以下に明示的に同意することでさらに折り畳むことができる >
:let g:java_consent_to_html_syntax_folding = 1
Javadoc コメント内のすべての開始タグとオプションの終了タグがバランスが取れてい
ない限り、この種の折り畳みをデフォルトにしないこと。そうでない場合は、構文の愛
ライトを壊す暴走した折り畳みが作成されることを我慢すること。

末尾の空白文字またはタブ文字の前の連続したスペース文字は、以下でエラーとして
マークされる >
:let g:java_space_errors = 1
Expand Down
22 changes: 18 additions & 4 deletions en/syntax.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 15
*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 28


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1056,8 +1056,12 @@ Variable Highlight ~
*c_ansi_typedefs* ... but do standard ANSI types
*c_ansi_constants* ... but do standard ANSI constants
*c_no_utf* don't highlight \u and \U in strings
*c_syntax_for_h* for *.h files use C syntax instead of C++ and use objc
syntax instead of objcpp
*c_syntax_for_h* use C syntax for *.h files instead of C++/ObjC/ObjC++
(NOTE: This variable is deprecated and no longer
necessary, as *.h files now default to C, unless the
file contains C++ or Objective-C syntax. If the
automated detection fails, the default filetype can
be adjusted using `g:filetype_h`.)
*c_no_if0* don't highlight "#if 0" blocks as comments
*c_no_cformat* don't highlight %-formats in strings
*c_no_c99* don't highlight C99 standard items
Expand Down Expand Up @@ -1116,8 +1120,11 @@ the C syntax file. See |c.vim| for all the settings that are available for C.

By setting a variable you can tell Vim to use Ch syntax for *.h files, instead
of C or C++: >
:let ch_syntax_for_h = 1
:let g:filetype_h = 'ch'

NOTE: In previous versions of Vim, the following (now-deprecated) variable was
used, but is no longer the preferred approach: >
:let ch_syntax_for_h = 1

CHILL *chill.vim* *ft-chill-syntax*

Expand Down Expand Up @@ -2168,6 +2175,13 @@ line for any comments written in this way, and showing the contents of a first
line otherwise, with >
:let g:java_foldtext_show_first_or_second_line = 1

HTML tags in Javadoc comments can additionally be folded by following the
instructions listed under |html-folding| and giving explicit consent with >
:let g:java_consent_to_html_syntax_folding = 1
Do not default to this kind of folding unless ALL start tags and optional end
tags are balanced in Javadoc comments; otherwise, put up with creating runaway
folds that break syntax highlighting.

Trailing whitespace characters or a run of space characters before a tab
character can be marked as an error with >
:let g:java_space_errors = 1
Expand Down