Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a gvim-help-doc-like text file?

Tags:

vim

gvim help doc contains "links",I can jump to subject by hit ctrl+] How to format a text which can functioning like that

like image 596
aztack Avatar asked Apr 07 '11 04:04

aztack


2 Answers

There is a section in the help dedicated to that topic : "Writing help files"

See : help help-writing or :help helphelp.txt

Excerpt :

TAGS


To define a help tag, place the name between asterisks (*tag-name*). 

(...)

When referring to an existing help tag and to create a hot-link, place the
name between two bars (|) eg. |help-writing|.

To get more details, please read the previously mentioned help files.

like image 56
Xavier T. Avatar answered Oct 26 '22 07:10

Xavier T.


Vim's help files exist in $VIMRUNTIME/doc, so if you view these files and set

set syntax=off

this will give you an idea of the mark-up. Basically you create links by enclosing them in pipes:

go to a link |here|

which will jump to an occurrence of the link text enclosed in asterisks, i.e. *here*.

Then you just need to do

set filetype=help

for your files, which you can achieve with an autocommand.

like image 37
Prince Goulash Avatar answered Oct 26 '22 06:10

Prince Goulash