diff --git a/doc/syntax.jax b/doc/syntax.jax index 332ae8982..cacb6f5b8 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -1,4 +1,4 @@ -*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Sep 10 +*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Sep 16 VIMリファレンスマニュアル by Bram Moolenaar @@ -2322,6 +2322,23 @@ lite構文ハイライトには2つのオプションがある。 :let lite_minlines = 200 +LOG *ft-log-syntax* + +Vim には、シンプルで汎用的なログ構文ハイライト機能が付属している。ログファイル +形式が非常に汎用的であるため、ハイライト機能はデフォルトでは有効になっていな +い。ハイライト機能は目障りになる可能性があるためである。この機能を有効にするに +は、シンプルにファイルタイプを "log" に手動で設定する: > + + :set ft=log + +これを "*.log" ファイルに対して自動的に有効にするには、個人の `filetype.vim` +ファイル (通常、Unix では `~/.vim/filetype.vim` または +`$HOME/vimfiles/filetype.vim` にある。|new-filetype| も参照) に以下のコードを +追加する: > + + augroup filetypedetect + au! BufNewFile,BufRead *.log setfiletype log + augroup END LPC *lpc.vim* *ft-lpc-syntax* @@ -2437,21 +2454,26 @@ V release 4で供給される標準的なパッケージセットの関数がユ MARKDOWN *ft-markdown-syntax* *g:markdown_minlines* *g:markdown_fenced_languages* *g:markdown_syntax_conceal* -長い領域がある場合、間違ったハイライトがおこなわれる可能性がある。表示を遅くす -る代償として、エンジンに領域の開始を同期するためにもっと後方を見るようにするこ -とができる。500行の例 (デフォルトは 50): > +領域が長い場合は、ハイライトが不正確になる可能性がある。表示を遅くする代償とし +て、エンジンに領域の開始を同期するためにもっと後方を見るようにすることができ +る。500行の例 (デフォルトは 50): > :let g:markdown_minlines = 500 markdown ドキュメントで囲われたコードブロックの構文ハイライトを有効にしたい場 -合は、以下のようにする: > +合は、以下の変数を設定する: > :let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] -markdown 構文の conceal を無効にするには、vimrc に以下を追加する: > +Markdown 構文の conceal を無効にするには、vimrc に以下を追加する: > :let g:markdown_syntax_conceal = 0 +引用、脚注、数式、学術的な文章要素、埋め込みコードブロックのハイライト表示と +いった高度な機能を備えた拡張 Markdown のサポートについては、Pandoc 構文プラグ +インの使用を検討すること。`g:filetype_md` を 'pandoc' に設定し、設定の詳細につ +いては |ft-pandoc-syntax| を参照。 + MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax* 次を .vimrc に書いておかないかぎり、空の *.m ファイルは自動的に Matlab のファ @@ -4716,6 +4738,13 @@ containedin={group-name}... *:syn-containedin* がそれらのグループの内側で始まることが許可される。これは外側のアイテムが引数 "contains=" でこのアイテムを指定したのと同じように動作する。 +直接の包含アイテム (構文スタックの先頭にある項目) のみが考慮される。Vim は他の +祖先は検索しない。直接の包含アイテムが |:syn-contains| でこのアイテムを含まず、 +またこの項目の "containedin=" にも指定されていない場合、祖先がマッチを許可して +いてもマッチは開始されない。 +Note |:syn-transparent| 領域は、独自の |:syn-contains| リストを強制することに +注意。 + {group-name}...の指定の仕方は前述の "contains" と同様である。 これは構文アイテムを後から追加するときに便利である。既に定義されているアイテム @@ -4727,6 +4756,7 @@ containedin={group-name}... *:syn-containedin* "containedin" の照合は、このアイテムが現れる場所に追加される。引数 "contains" も通常通り追加される。注意: キーワードは他のアイテムを含むことができないため、 "containedin" の先にキーワードを指定することは無意味である。 +|:syn-contains|、|:syn-transparent| も参照。 nextgroup={group-name},.. *:syn-nextgroup* diff --git a/en/syntax.txt b/en/syntax.txt index 39a64da63..cde13c064 100644 --- a/en/syntax.txt +++ b/en/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2025 Sep 10 +*syntax.txt* For Vim version 9.1. Last change: 2025 Sep 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2385,6 +2385,22 @@ set "lite_minlines" to the value you desire. Example: > :let lite_minlines = 200 +LOG *ft-log-syntax* + +Vim comes with a simplistic generic log syntax highlighter. Because the log +file format is so generic, highlighting is not enabled by default, since it +can be distracting. If you want to enable this, simply set the "log" filetype +manually: > + + :set ft=log + +To enable this automatically for "*.log" files, add the following to your +personal `filetype.vim` file (usually located in `~/.vim/filetype.vim` on Unix +or `$HOME/vimfiles/filetype.vim`, see also |new-filetype|): > + + augroup filetypedetect + au! BufNewFile,BufRead *.log setfiletype log + augroup END LPC *lpc.vim* *ft-lpc-syntax* @@ -2504,21 +2520,26 @@ $VIMRUNTIME/syntax/syntax.vim). MARKDOWN *ft-markdown-syntax* *g:markdown_minlines* *g:markdown_fenced_languages* *g:markdown_syntax_conceal* -If you have long regions there might be wrong highlighting. At the cost of +If you have long regions there may be incorrect highlighting. At the cost of slowing down displaying, you can have the engine look further back to sync on the start of a region, for example 500 lines (default is 50): > :let g:markdown_minlines = 500 -If you want to enable fenced code block syntax highlighting in your markdown -documents you can enable like this: > +If you want to enable fenced code block syntax highlighting in your Markdown +documents, set the following variable: > :let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] -To disable markdown syntax concealing add the following to your vimrc: > +To disable Markdown syntax concealing, add the following to your vimrc: > :let g:markdown_syntax_conceal = 0 +For extended Markdown support with enhanced features such as citations, +footnotes, mathematical formulas, academic writing elements and embedded code +block highlighting, consider using the pandoc syntax plugin. Set +`g:filetype_md` to 'pandoc' and see |ft-pandoc-syntax| for configuration +details. MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax* @@ -4861,6 +4882,13 @@ The "containedin" argument is followed by a list of syntax group names. The item will be allowed to begin inside these groups. This works as if the containing item has a "contains=" argument that includes this item. +Only the immediate containing item (the one at the top of the syntax stack) is +considered. Vim does not search other ancestors. If the immediate container +neither contains this item via |:syn-contains| nor is named in this item's +"containedin=", the match will not start even if some ancestor would allow it. +Note that a |:syn-transparent| region still enforces its own |:syn-contains| +list. + The {group-name}... can be used just like for "contains", as explained above. 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 appear. A "contains" argument may also be added as usual. Don't forget that keywords never contain another item, thus adding them to "containedin" won't work. +See also: |:syn-contains|, |:syn-transparent|. nextgroup={group-name},.. *:syn-nextgroup*