Question

I download vim-php-manual in this page and unzip in ~/.vim/vim-php-manual(the tgz file has a tags file). I can use K on some function name and see the parameter of this function. Everything is good.

But I execute :Helptags in Vim normal mode, it generate some wired tags in ~/.vim/vim-php-manual.

/   apache-request-headers.txt  /*\/*
NOT strtr.txt   /*NOT*
estimated   ifx-getsqlca.txt    /*estimated*

I think Vim must generate wrong tags with wrong symbol. I open the file ~/.vim/vim-php-manual/ifx-getsqlca.txt and :set ft=text. I see estimated being surround star sign(*), like *estimated*, so Vim treat it as the tags name.

Is that mean I can't execute :Helptags forever? Because it always generates wrong tags for vim-php-manual

It seems contradiction because vim will find the help file in runtimepath and :Helptags will generate tags with runtimepath?

Was it helpful?

Solution

It is odd that one of the files I get when I expand vim-php-manual.tgz is vim-php-manual.tgz.

When I expand the archive, I get a bunch of *.txt files, a tags file, and the odd file I just mentioned. No subdirectories, nothing else. So all you have to do is create a directory, expand the archive into it, and adjust the 'tags' option in vim. (Use a FileType autocommand or put it in .../after/ftplugin/php.vim if you want the setting only when you are editing PHP.)

I think the idea is to use the tags file that comes bundled with the archive, not to generate it from the help files using vim. If you need to regenerate the tags file, then follow the instructions on the page where you found the archive.

The :Helptags function (part of the pathogen plugin) only parses files with the extension .txt that are in a directory doc/ somewhere under 'runtimepath'. If you do not want to overwrite the tags file when you run :Helptags, then call the directory where you put these files something other than doc/, for example doc-php/ or vim-php-manual/.

I just did that, putting the files in ~/.vim/vim-php-manual/, and ran :Helptags and it did not have any effect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top