Hi,
Maybe I messup things.
I want to extract tags in my documents. Tags are present in the format the vim
help files are.
Example
*tag1* *tag2*
Here, there is two options to extract the tags and I have tested both of them.
1. :helptags. It is a vim built-in function to extract the tags but only works
for ".txt" and ".??x" file extensions.
My files do not have that extension so I can't use it. I have searched for
an option to change but I haven't found it.
2. ctags. It does not have language support for vim help. It does vim language
but It is for vim script. I have created an extension to the language with this
content (I call my new language MAN)
--langdef=MAN
--language-force=MAN
--regex-MAN=/\*([^\.\*][^\*]*)\*/\1/
This works fine. Extract the tags inside starts. But there is a problem with
several tags in the same line. For this issue I put the C example. Not because
I want to use ctags to extract C tags but because ctags can extract several C
tags in the same line.
Regards,
Javier
El miércoles, 10 de julio de 2013 16:10:16 UTC+2, Tony Mechelynck escribió:
> On 10/07/13 15:33, Javier Mediavilla Vegas wrote:
>
> > Hi,
>
> > I want to extrack tags from files like :helptags does. The problem is that
> > :helptags can only work with .txt and .??x files. I want to do it for a
> > file with any file extension.
>
> > I have tried with ctags and defining my own language extension.
> > Nevertheless, when two tags are in the same line, ctags only matches the
> > first one.
>
> >
>
> > Example:
>
> > *E101* *E102*
>
> >
>
> > ctags will extract "E101" without extracting E102. I think this should be
> > able to be done with ctags because in C language you can define two
> > functions in the same line
>
> >
>
> > Example:
>
> > int add(void){return 5;} void some(void){}
>
> >
>
> > and ctags extract both of them althouth they are in the same line.
>
> >
>
> > The last change I take into account is to modify "helptags" function in the
> > source code, that has ".txt" and "??x" files hardcoded.
>
> >
>
> > Any idea how to achieve this without touching source code?
>
> >
>
> > Thanks in advance,
>
> > Javier.
>
> >
>
>
>
> To use tags, you need to have a tags file containing the proper
>
> information. For C and a number of other languages, Exuberant Ctags can
>
> do it. I notice the following paragraph near the end of the manpage for
>
> that particular ctags program:
>
>
>
> Credit is also due Bram Moolenaar <[email protected]>, the author of vim, who
>
> has devoted so much of his time and energy both to developing the editor
>
> as a service to others, and to helping the orphans of Uganda.
>
>
>
> Just program as you normally would, then run Exuberant Ctags on your source.
>
>
>
> For Vim helpfiles, Vim can also generate the tags file itself (see :help
>
> :helptags). If you want to write documentation in any filetype that
>
> suits your fancy, and still use |bars| and *stars* as in Vim
>
> documentation, you may have to give appropriate options to Exuberant
>
> Ctags to tell it that "these files are Vim helpfiles even though their
>
> names don't end in .txt". If you didn't (yet) succeed at it, maybe
>
> there's a parameter you missed. If you have a Unix-like (including
>
> Linux, Cygwin, and, I think, Mac OSX) version of Exuberant Ctags, check
>
> its manpage (and, first, run "ctags --version": if it is Exuberant
>
> Ctags, it will proudly tell you).
>
>
>
>
>
> Best regards,
>
> Tony.
>
> --
>
> Reality is a cop-out for people who can't handle drugs.
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.