|
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 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -433,17 +433,38 @@ To quote a block of ex-commands verbatim, place a greater than (>) character |
433 | 433 | at the end of the line before the block and a less than (<) character as the |
434 | 434 | first non-blank on a line following the block. Any line starting in column 1 |
435 | 435 | 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 |
439 | 439 | < |
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. |
442 | 449 | E.g: >vim |
443 | | - function Example_Func() |
444 | | - echo "Example" |
445 | | - endfunction |
| 450 | + function Example_Func() |
| 451 | + echo "Example" |
| 452 | + endfunction |
446 | 453 | < |
| 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* |
447 | 468 | The following are highlighted differently in a Vim help file: |
448 | 469 | - a special key name expressed either in <> notation as in <PageDown>, or |
449 | 470 | as a Ctrl character as in CTRL-X |
|
0 commit comments