This is the documentation page for Template:Help
Use this template in a tip to add a link to the Vim Help documentation.
Usage
{{help|
topic}}
{{help|id=
topic}}
{{help|id=
topic|label=
display}}
{{help|tag=
topic|label=
display}}
{{help|prefix=no|
topic}}
When using the first form, the parameter topic:
- Must not contain an equals character ('=').
- Must not contain text that the wiki might mistake for an html tag.
For example, if topic is z= you would use {{help|id=z=}}
(if you just have z=
, the wiki thinks you are assigning an empty string to a parameter named z).
Use the third form if topic contains something looking like an html tag (example: <S-F1>
).
The display text should be topic where you have replaced < with <
and > with >
.
In difficult cases, you can use the fourth form and encode topic and display – see Problem characters.
The prefix parameter can be set to no in order to hide the ":help " prefix of the link.
Examples
{{help|'shellslash'}}
gives :help 'shellslash'{{help|prefix=no|'shellslash'}}
gives 'shellslash'{{help|:command}}
gives :help :command{{help|match()}}
gives :help match(){{help|z}}
gives :help z{{help|/}}
gives :help /{{help|*}}
gives :help *{{help|"*}}
gives :help "*{{help|id==}}
gives :help ={{help|id=<>|label=<>}}
gives :help <>
You should try to use the correct case for topic, although it usually does not matter. Following is an example showing how case-sensitivity can be important.
If topic does not contain =
you can omit the id=
and label=
parameter names.
Warning: You have to omit them both, like this:
{{help|<|<}}
gives :help <
Problem characters
Using angle brackets (<
or >
) or square brackets ([
or ]
) or a bar (|
) can confuse the wiki.
A solution that should always work is to use:
{{help|tag=
topic|label=
display}}
where topic has been "url encoded" by substituting values from the Tag column in the table below, and display has been "escaped" by substituting values from the Label column.
Character | Tag | Label |
---|---|---|
[ |
%5B | [ |
] |
%5D | ] |
< |
%3C | < |
> |
%3E | > |
| |
%7C | | |
Examples
{{help|tag=%5D%5D|label=]]}}
gives :help ]]{{help|tag=%3CS-F1%3E|label=<S-F1>}}
gives :help <S-F1>{{help|tag=%7C|label=|}}
gives :help |
Quick Reference
Copy the following into a text file for a quick reference.
Example TOPIC DISPLAY {{help|TOPIC}} No = < > [ ] | {{help|id=TOPIC}} No < > [ ] | {{help|id=TOPIC|label=DISPLAY}} No [ ] | Use < > {{help|tag=TOPIC|label=DISPLAY}} Use %HH encoding Use &#NN; encoding Char Tag Label [ %5B [ ] %5D ] < %3C < > %3E > | %7C | Some topics (example <S-F1>) need to be encoded to avoid a wiki problem. You should use the correct case (what Vim shows). Examples zE {{help|zE}} z= {{help|id=z=}} < {{help|<|<}} ]] {{help|tag=%5D%5D|label=]]}}
Known bugs
- Tags containing angle brackets, square brackets, or a bar, can give trouble with html or templates – see Problem characters.
- The wiki seems to have a bug processing some tags beginning with
<s-
. The link created can be totally wrong. Use the Problem characters workaround. - Please add a comment at User_talk:JohnBeckett if you find a problem.