Skip to content

Commit 79860cd

Browse files
committed
Update helphelp.{txt,jax}
1 parent 39ecfab commit 79860cd

File tree

2 files changed

+59
-18
lines changed

2 files changed

+59
-18
lines changed

doc/helphelp.jax

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*helphelp.txt* For Vim バージョン 9.1. Last change: 2024 Dec 15
1+
*helphelp.txt* For Vim バージョン 9.1. Last change: 2024 Dec 25
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -426,17 +426,37 @@ Ex コマンドのブロックを例示するときは、大なり記号 (>) を
426426
末に書き、小なり記号 (<) をその後ろのブロックの前の最初の非空白文字として書き
427427
ます。テキストが 1 列目から始まっている行があると、Ex コマンドのブロックはその
428428
直前で暗黙的に終了となります。例: >
429-
function Example_Func()
430-
echo "Example"
431-
endfunction
429+
function Example_Func()
430+
echo "Example"
431+
endfunction
432432
<
433-
コード例に Vim 構文ハイライトサポートを追加することができます。これは、大なり
434-
記号 (>) の後に "vim" を追加することで可能です (">vim")。
433+
434+
ブロックに注釈を追加するには、大なり記号 (>) の後に注釈 (例: "lua") を配置しま
435+
す。例: >lua
436+
print("hello")
437+
<
438+
Note: |g:help_example_languages| に "lua" キーがある場合は、lua 構文のハイライ
439+
トを使用します。
440+
441+
コード例に Vim 構文ハイライトのサポートを追加することができます。
435442
例: >vim
436-
function Example_Func()
437-
echo "Example"
438-
endfunction
443+
function Example_Func()
444+
echo "Example"
445+
endfunction
439446
<
447+
*g:help_example_languages*
448+
ブロック内の構文ハイライトを変更する場合は、以下のように変更できます: >
449+
:let g:help_example_languages = #{ vim: 'vim', sh: 'bash' }
450+
キーは注釈マーカー名を表し、値は 'syntax' 名です。デフォルトでは、ヘルプファイ
451+
ルは Vim script のハイライトのみをサポートします。
452+
Note: "g:help_example_languages" を設定するときに "vim" キーを含めないと、Vim
453+
構文ハイライトは有効になりません。空の値に設定すると、埋め込み言語の構文のハイ
454+
ライトは無効になります。
455+
456+
さらに note: 含まれている 'syntax' スクリプトがそのような趣旨を考慮していない
457+
場合、ヘルプファイルに追加の構文言語を含めることは必ずしも完全に機能するとは限
458+
りません。
459+
*help-notation*
440460
Vim ヘルプファイルでは以下のものがそれぞれハイライトされます:
441461
- 特殊キーの名前。<PageDown> のような <> 表記で書かれたものと、CTRL-X のよう
442462
に書かれた制御文字。

en/helphelp.txt

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*helphelp.txt* For Vim version 9.1. Last change: 2024 Dec 15
1+
*helphelp.txt* For Vim version 9.1. Last change: 2024 Dec 25
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -433,17 +433,38 @@ To quote a block of ex-commands verbatim, place a greater than (>) character
433433
at the end of the line before the block and a less than (<) character as the
434434
first non-blank on a line following the block. Any line starting in column 1
435435
also implicitly stops the block of ex-commands before it. E.g. >
436-
function Example_Func()
437-
echo "Example"
438-
endfunction
436+
function Example_Func()
437+
echo "Example"
438+
endfunction
439439
<
440-
It's possible to add Vim syntax highlighting support to code examples. This
441-
can be done by adding "vim" after the greater than (>) character (">vim").
440+
441+
To add annotation in the block, place the annotation (ex: "lua") after a
442+
greater than (>) character. E.g: >lua
443+
print("hello")
444+
<
445+
Note: uses lua syntax highlighting, if "lua" key is in
446+
|g:help_example_languages|.
447+
448+
It's possible to add Vim syntax highlighting support to code examples.
442449
E.g: >vim
443-
function Example_Func()
444-
echo "Example"
445-
endfunction
450+
function Example_Func()
451+
echo "Example"
452+
endfunction
446453
<
454+
*g:help_example_languages*
455+
If you want to change the syntax highlighting in the block, you can
456+
change it like this: >
457+
:let g:help_example_languages = #{ vim: 'vim', sh: 'bash' }
458+
The key represents the annotation marker name, and the value is the 'syntax'
459+
name. By default, help files support only Vim script highlighting.
460+
Note: When setting "g:help_example_languages", if you do not include "vim"
461+
key, the Vim syntax highlighting will not be enabled. If you set it to an
462+
empty value, syntax highlighting for embedded languages will be disabled.
463+
464+
Further note: including additional syntax languages into help files may not
465+
always work perfectly, if the included 'syntax' script does not account for
466+
such an import.
467+
*help-notation*
447468
The following are highlighted differently in a Vim help file:
448469
- a special key name expressed either in <> notation as in <PageDown>, or
449470
as a Ctrl character as in CTRL-X

0 commit comments

Comments
 (0)