0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

runtime(doc): tweak documentation style in helphelp.txt

closes: #16302

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
h-east 2024-12-26 10:22:46 +01:00 committed by Christian Brabandt
parent 9b67a2e1dd
commit b9ea0a89fa
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 9.1. Last change: 2024 Dec 25 *helphelp.txt* For Vim version 9.1. Last change: 2024 Dec 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -437,31 +437,24 @@ also implicitly stops the block of ex-commands before it. E.g. >
echo "Example" echo "Example"
endfunction endfunction
< <
To enable syntax highlighting for a block of code, place a language name
To add annotation in the block, place the annotation (ex: "lua") after a annotation (e.g. "vim") after a greater than (>) character. E.g. >vim
greater than (>) character. E.g: >lua
print("hello")
<
Note: uses lua syntax highlighting, if "lua" key is in
|g:help_example_languages|.
It's possible to add Vim syntax highlighting support to code examples.
E.g: >vim
function Example_Func() function Example_Func()
echo "Example" echo "Example"
endfunction endfunction
< <
*g:help_example_languages* *g:help_example_languages*
If you want to change the syntax highlighting in the block, you can By default, help files only support Vim script highlighting. If you need
change it like this: > syntax highlighting for other languages, add to your |vimrc|: >
:let g:help_example_languages = #{ vim: 'vim', sh: 'bash' } :let g:help_example_languages = { "vim": "vim", "sh": "bash" }
The key represents the annotation marker name, and the value is the 'syntax' The key represents the annotation marker name, and the value is the 'syntax'
name. By default, help files support only Vim script highlighting. name.
Note: When setting "g:help_example_languages", if you do not include "vim"
key, the Vim syntax highlighting will not be enabled. If you set it to an Note: If you do not include "vim" in "g:help_example_languages", its syntax
highlighting will not be enabled. If you set "g:help_example_languages" to an
empty value, syntax highlighting for embedded languages will be disabled. empty value, syntax highlighting for embedded languages will be disabled.
Further note: including arbitrary syntax languages into help files may not Further note: Including arbitrary syntax languages into help files may not
always work perfectly, if the included 'syntax' script does not account for always work perfectly, if the included 'syntax' script does not account for
such an import. such an import.
*help-notation* *help-notation*