How to create the own tag files with Vim for interconnected non-code text

tagsvim

I'm writing a fair bit of interconnected non-code text in vim, and I'd like to generate my own tags to use with vim tagging.

For example, there's a file all about "foo", and ideally, whenever I'm editing the files "bar" and "baz" and the word "foo" comes up, I'd like to be able to hit ^] and jump to the foo file, and then hit ^T and jump back to wherever I was.

Is there any way for me to make my own tag files where the word "foo" points to the file "foo" and so on and so forth? Every source that I have checked just explains how to use ctags to generate tags for every programming language under the sun, but I'd just like to be able to create a simple tag file of my own.

Best Answer

If I understood right (and that's a capital IF) what you are looking for is basic vim help functionality. You define a tag (some_word) a lot of jumppoints (|jumppoint|) and that's it.

Without going into the details I'd really recommend you glance through the

:help tags

help file. It will explain a lot. I haven't done this in a while, but basically it comes down to this. You need to define tags (**), and then introduce them into vim's tag system via :helptags command. After that, don't move them, and when using jumppoints it will lead you to them via already mentioned Ctrl-] and T.

ctags and the like should not worry you ... this is completely vim's functionality, and they have nothing to do with it (they only come into the story when code comes into it ... and even then, in some cases, if you're willing to do some manual labour they can be avoided).

Related Question