Skip to content

Commit 222af87

Browse files
committed
Update syntax.{txt,jax}
1 parent ec8ba50 commit 222af87

File tree

2 files changed

+70
-11
lines changed

2 files changed

+70
-11
lines changed

doc/syntax.jax

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Sep 10
1+
*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Sep 16
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -2322,6 +2322,23 @@ lite構文ハイライトには2つのオプションがある。
23222322
23232323
:let lite_minlines = 200
23242324
2325+
LOG *ft-log-syntax*
2326+
2327+
Vim には、シンプルで汎用的なログ構文ハイライト機能が付属している。ログファイル
2328+
形式が非常に汎用的であるため、ハイライト機能はデフォルトでは有効になっていな
2329+
い。ハイライト機能は目障りになる可能性があるためである。この機能を有効にするに
2330+
は、シンプルにファイルタイプを "log" に手動で設定する: >
2331+
2332+
:set ft=log
2333+
2334+
これを "*.log" ファイルに対して自動的に有効にするには、個人の `filetype.vim`
2335+
ファイル (通常、Unix では `~/.vim/filetype.vim` または
2336+
`$HOME/vimfiles/filetype.vim` にある。|new-filetype| も参照) に以下のコードを
2337+
追加する: >
2338+
2339+
augroup filetypedetect
2340+
au! BufNewFile,BufRead *.log setfiletype log
2341+
augroup END
23252342
23262343
LPC *lpc.vim* *ft-lpc-syntax*
23272344

@@ -2437,21 +2454,26 @@ V release 4で供給される標準的なパッケージセットの関数がユ
24372454
MARKDOWN *ft-markdown-syntax* *g:markdown_minlines*
24382455
*g:markdown_fenced_languages* *g:markdown_syntax_conceal*
24392456

2440-
長い領域がある場合、間違ったハイライトがおこなわれる可能性がある。表示を遅くす
2441-
る代償として、エンジンに領域の開始を同期するためにもっと後方を見るようにするこ
2442-
とができる。500行の例 (デフォルトは 50): >
2457+
領域が長い場合は、ハイライトが不正確になる可能性がある。表示を遅くする代償とし
2458+
て、エンジンに領域の開始を同期するためにもっと後方を見るようにすることができ
2459+
。500行の例 (デフォルトは 50): >
24432460
24442461
:let g:markdown_minlines = 500
24452462
24462463
markdown ドキュメントで囲われたコードブロックの構文ハイライトを有効にしたい場
2447-
合は、以下のようにする: >
2464+
合は、以下の変数を設定する: >
24482465
24492466
:let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
24502467
2451-
markdown 構文の conceal を無効にするには、vimrc に以下を追加する: >
2468+
Markdown 構文の conceal を無効にするには、vimrc に以下を追加する: >
24522469
24532470
:let g:markdown_syntax_conceal = 0
24542471
2472+
引用、脚注、数式、学術的な文章要素、埋め込みコードブロックのハイライト表示と
2473+
いった高度な機能を備えた拡張 Markdown のサポートについては、Pandoc 構文プラグ
2474+
インの使用を検討すること。`g:filetype_md`'pandoc' に設定し、設定の詳細につ
2475+
いては |ft-pandoc-syntax| を参照。
2476+
24552477
MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax*
24562478

24572479
次を .vimrc に書いておかないかぎり、空の *.m ファイルは自動的に Matlab のファ
@@ -4716,6 +4738,13 @@ containedin={group-name}... *:syn-containedin*
47164738
がそれらのグループの内側で始まることが許可される。これは外側のアイテムが引数
47174739
"contains=" でこのアイテムを指定したのと同じように動作する。
47184740

4741+
直接の包含アイテム (構文スタックの先頭にある項目) のみが考慮される。Vim は他の
4742+
祖先は検索しない。直接の包含アイテムが |:syn-contains| でこのアイテムを含まず、
4743+
またこの項目の "containedin=" にも指定されていない場合、祖先がマッチを許可して
4744+
いてもマッチは開始されない。
4745+
Note |:syn-transparent| 領域は、独自の |:syn-contains| リストを強制することに
4746+
注意。
4747+
47194748
{group-name}...の指定の仕方は前述の "contains" と同様である。
47204749

47214750
これは構文アイテムを後から追加するときに便利である。既に定義されているアイテム
@@ -4727,6 +4756,7 @@ containedin={group-name}... *:syn-containedin*
47274756
"containedin" の照合は、このアイテムが現れる場所に追加される。引数 "contains"
47284757
も通常通り追加される。注意: キーワードは他のアイテムを含むことができないため、
47294758
"containedin" の先にキーワードを指定することは無意味である。
4759+
|:syn-contains||:syn-transparent| も参照。
47304760

47314761

47324762
nextgroup={group-name},.. *:syn-nextgroup*

en/syntax.txt

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 9.1. Last change: 2025 Sep 10
1+
*syntax.txt* For Vim version 9.1. Last change: 2025 Sep 16
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2385,6 +2385,22 @@ set "lite_minlines" to the value you desire. Example: >
23852385
23862386
:let lite_minlines = 200
23872387
2388+
LOG *ft-log-syntax*
2389+
2390+
Vim comes with a simplistic generic log syntax highlighter. Because the log
2391+
file format is so generic, highlighting is not enabled by default, since it
2392+
can be distracting. If you want to enable this, simply set the "log" filetype
2393+
manually: >
2394+
2395+
:set ft=log
2396+
2397+
To enable this automatically for "*.log" files, add the following to your
2398+
personal `filetype.vim` file (usually located in `~/.vim/filetype.vim` on Unix
2399+
or `$HOME/vimfiles/filetype.vim`, see also |new-filetype|): >
2400+
2401+
augroup filetypedetect
2402+
au! BufNewFile,BufRead *.log setfiletype log
2403+
augroup END
23882404
23892405
LPC *lpc.vim* *ft-lpc-syntax*
23902406

@@ -2504,21 +2520,26 @@ $VIMRUNTIME/syntax/syntax.vim).
25042520
MARKDOWN *ft-markdown-syntax* *g:markdown_minlines*
25052521
*g:markdown_fenced_languages* *g:markdown_syntax_conceal*
25062522

2507-
If you have long regions there might be wrong highlighting. At the cost of
2523+
If you have long regions there may be incorrect highlighting. At the cost of
25082524
slowing down displaying, you can have the engine look further back to sync on
25092525
the start of a region, for example 500 lines (default is 50): >
25102526
25112527
:let g:markdown_minlines = 500
25122528
2513-
If you want to enable fenced code block syntax highlighting in your markdown
2514-
documents you can enable like this: >
2529+
If you want to enable fenced code block syntax highlighting in your Markdown
2530+
documents, set the following variable: >
25152531
25162532
:let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
25172533
2518-
To disable markdown syntax concealing add the following to your vimrc: >
2534+
To disable Markdown syntax concealing, add the following to your vimrc: >
25192535
25202536
:let g:markdown_syntax_conceal = 0
25212537
2538+
For extended Markdown support with enhanced features such as citations,
2539+
footnotes, mathematical formulas, academic writing elements and embedded code
2540+
block highlighting, consider using the pandoc syntax plugin. Set
2541+
`g:filetype_md` to 'pandoc' and see |ft-pandoc-syntax| for configuration
2542+
details.
25222543

25232544
MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax*
25242545

@@ -4861,6 +4882,13 @@ The "containedin" argument is followed by a list of syntax group names. The
48614882
item will be allowed to begin inside these groups. This works as if the
48624883
containing item has a "contains=" argument that includes this item.
48634884

4885+
Only the immediate containing item (the one at the top of the syntax stack) is
4886+
considered. Vim does not search other ancestors. If the immediate container
4887+
neither contains this item via |:syn-contains| nor is named in this item's
4888+
"containedin=", the match will not start even if some ancestor would allow it.
4889+
Note that a |:syn-transparent| region still enforces its own |:syn-contains|
4890+
list.
4891+
48644892
The {group-name}... can be used just like for "contains", as explained above.
48654893

48664894
This is useful when adding a syntax item afterwards. An item can be told to
@@ -4875,6 +4903,7 @@ Matches for "containedin" are added to the other places where the item can
48754903
appear. A "contains" argument may also be added as usual. Don't forget that
48764904
keywords never contain another item, thus adding them to "containedin" won't
48774905
work.
4906+
See also: |:syn-contains|, |:syn-transparent|.
48784907

48794908

48804909
nextgroup={group-name},.. *:syn-nextgroup*

0 commit comments

Comments
 (0)