I have been wanting to write some docs with the tag features found in vim help but I couldn't find anything online that had a simple and specific solution. So for anyone who may currently be looking for a quick solution to this, I will share what I have found.
The quickest way to get up and running:
Lets say you are working in an empty folder.
If you create a file such as this test.txt:
|topic1|
*topic1*
Then run:
:helptags ./
Vim will generate a file (tags) in the current dir (./) that will let you jump (ctrl+]) from |topic1| to *topic1*
If you open up the tags file you can see its simplicity:
topic1 test.txt /*topic1*
Format:
[key word][TAB][file][TAB][command]
You can add other tags to this file and they will work right away.
Of course the best part of tags is the ability to jump to definitions in other files which can be accomplished by changing the [file] argument in the tags file. Again, you will need to have a |tag| in the parent file and a *tag* in the child file for it to work.
Writing the tags file from scratch also seems to work without issue if it is named "tags" and you run :helptags ./ in vim afterwards.
Note:
As others have mentioned in this post, :help is your friend. If you enjoy vim, you should spend some time flipping through the manual, everything is very well documented. If you don't enjoy vim, you can still use the manual for quick searches. In my experience, I can usually get to a solution through the man pages faster than I can searching online. Just remember the following:
/
to start searching
ctrl+]
to jump to file / definition
ctrl+o
to jump back
These basic navigation commands are also displayed as soon as you open :help
There was also one guy (blog) where he did exactly what you're looking to do now, but I cannot find it. When I do, I'll post a link. – Rook – 2010-01-11T00:27:43.793