From f54ca67675733e4bb499fa53b6bf9d28b78a9c9a Mon Sep 17 00:00:00 2001 From: h-east Date: Tue, 15 Jul 2025 22:06:12 +0900 Subject: [PATCH 1/2] Update syntax.{txt,jax} --- doc/syntax.jax | 45 +++++++++++++++++++++++++++++++++++++++------ en/syntax.txt | 44 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 77 insertions(+), 12 deletions(-) diff --git a/doc/syntax.jax b/doc/syntax.jax index 6b6ed5e55..093bad84b 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -1,4 +1,4 @@ -*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Jun 03 +*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Jul 14 VIMリファレンスマニュアル by Bram Moolenaar @@ -1544,15 +1544,48 @@ ERLANG *erlang.vim* *ft-erlang-syntax* Erlang は Ericsson が開発した関数型プログラミング言語である。次の拡張子のファ イルが Erlang ファイルとして認識される: erl, hrl, yaws -組み込み関数 (BIFs: built-in functions) はデフォルトで強調表示される。それを無 -効化するには vimrc で次のように設定する: > +Vim はデフォルトで、トリプルクォートで囲まれたドキュメント文字列をコメントとし +てハイライトする。 - :let g:erlang_highlight_bifs = 0 +トリプルクォートで囲まれたドキュメント文字列を Markdown としてハイライトしたい +場合は、|.vimrc| に次の行を追加する: > -いくつかの特殊アトムを強調表示するには、vimrc で次のように設定する: > + :let g:erlang_use_markdown_for_docs = 1 - :let g:erlang_highlight_special_atoms = 1 +ドキュメント文字列内のプレーンテキスト (つまり、Markdown 構文でハイライトされ +ない文字) は、コメントとしてハイライト表示される。 +ドキュメント文字列内のプレーンテキストを別のハイライトグループでハイライトした +い場合は、|.vimrc| に次の行を追加する (この例では、文字列ハイライトグループを +使用してプレーンテキストをハイライトしている): > + + :let g:erlang_docstring_default_highlight = 'String' + +Markdown を有効にしていない場合、この行は指定されたハイライトグループに従って +ドキュメントストリング全体をハイライトする。 + +プレーンテキストのハイライトを無効にするには、以下の行を使用する: > + + :let g:erlang_docstring_default_highlight = '' + +構成例: > + + " ドキュメント文字列をMarkdownとしてハイライトする。 + :let g:erlang_use_markdown_for_docs = 1 + + " 1. docstring 内の Markdown 要素を Markdown としてハイライトする。 + " 2. docstring 内のプレーンテキストを文字列としてハイライトする。 + :let g:erlang_use_markdown_for_docs = 1 + :let g:erlang_docstring_default_highlight = 'String' + + " docstring を文字列としてハイライトする (Markdown なし)。 + :let g:erlang_docstring_default_highlight = 'String' + + " 1. docstring 内の Markdown 要素を Markdown としてハイライトする。 + " 2. ドキュメント文字列内のプレーンテキストをハイライトしない。 + :let g:erlang_use_markdown_for_docs = 1 + :let g:erlang_docstring_default_highlight = '' +< ELIXIR *elixir.vim* *ft-elixir-syntax* diff --git a/en/syntax.txt b/en/syntax.txt index 44fed277f..b1f644e5b 100644 --- a/en/syntax.txt +++ b/en/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2025 Jun 03 +*syntax.txt* For Vim version 9.1. Last change: 2025 Jul 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1573,15 +1573,47 @@ ERLANG *erlang.vim* *ft-erlang-syntax* Erlang is a functional programming language developed by Ericsson. Files with the following extensions are recognized as Erlang files: erl, hrl, yaws. -The BIFs (built-in functions) are highlighted by default. To disable this, -put the following line in your vimrc: > +Vim highlights triple-quoted docstrings as comments by default. - :let g:erlang_highlight_bifs = 0 +If you want triple-quoted docstrings highlighted as Markdown, add the +following line to your |.vimrc|: > -To enable highlighting some special atoms, put this in your vimrc: > + :let g:erlang_use_markdown_for_docs = 1 - :let g:erlang_highlight_special_atoms = 1 +The plain text inside the docstrings (that is, the characters that are not +highlighted by the Markdown syntax) is still highlighted as a comment. +If you want to highlight the plain text inside the docstrings using a +different highlight group, add the following line to your |.vimrc| (the +example highlights plain text using the String highlight group): > + + :let g:erlang_docstring_default_highlight = 'String' + +If you don't enable Markdown, this line highlights the full docstrings +according to the specified highlight group. + +Use the following line to disable highlighting for the plain text: > + + :let g:erlang_docstring_default_highlight = '' + +Configuration examples: > + + " Highlight docstrings as Markdown. + :let g:erlang_use_markdown_for_docs = 1 + + " 1. Highlight Markdown elements in docstrings as Markdown. + " 2. Highlight the plain text in docstrings as String. + :let g:erlang_use_markdown_for_docs = 1 + :let g:erlang_docstring_default_highlight = 'String' + + " Highlight docstrings as strings (no Markdown). + :let g:erlang_docstring_default_highlight = 'String' + + " 1. Highlight Markdown elements in docstrings as Markdown. + " 2. Don't highlight the plain text in docstrings. + :let g:erlang_use_markdown_for_docs = 1 + :let g:erlang_docstring_default_highlight = '' +< ELIXIR *elixir.vim* *ft-elixir-syntax* From bb141dcec112893cd2e7ae4a4a3ddda270028d24 Mon Sep 17 00:00:00 2001 From: h_east Date: Sat, 19 Jul 2025 10:24:26 +0900 Subject: [PATCH 2/2] Update doc/syntax.jax Co-authored-by: Tsuyoshi CHO --- doc/syntax.jax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/syntax.jax b/doc/syntax.jax index 093bad84b..9d92dff71 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -1570,7 +1570,7 @@ Markdown を有効にしていない場合、この行は指定されたハイ 構成例: > - " ドキュメント文字列をMarkdownとしてハイライトする。 + " ドキュメント文字列を Markdown としてハイライトする。 :let g:erlang_use_markdown_for_docs = 1 " 1. docstring 内の Markdown 要素を Markdown としてハイライトする。