Is there any way I can get ctags to somehow support the built-in functions provided by PHP/Python (Or whatever I’m working with at that moment), so that I can also use those in Source Explorer in vim and alike?
Update:
Okay so with python I can just run ctags on the source folder to get a tags file with the built in functions, though with PHP it doesn’t seem to work, however the source files of PHP contain lines like the following:
/* {{{ proto resource mysql_connect([string hostname[:port][:/path/to/socket] [, string username [, string password [, bool new [, int flags]]]]])
So if I could somehow parse that with ctags I would get the appropriate functions in my tags file. I tried using –regex-C for it to pick it up but the following didn’t seem to work.
--regex-C='/\/\* \{\{\{ proto ([^ ]+) ([^ (]*)/\2/f/'
Any idea how to get this to work?
Also with python I seem to get the “class ClassName:” line with classes, is there any way for that to also include the init function?
Update:
I’ll just create a separate question for PHP, thanks for the answers.
ctagslets you build your tags database incrementally with the--appendoption; if you want the C definition for the Python routines (much? some? a little bit? is implemented directly in C, some in Python itself) you can run:If you want just a portion of the Python source code included, you can give just that portion; as you said in your comment,
Lib/is the place to start 🙂Given that most interpreted languages (and even byte-code-compiled languages) wind up implementing a fair amount of their interface in C behind the scenes, it might be difficult to have seamless transitions between your source and the source of the APIs you rely on.
I’ve found it helpful to have multiple databases for source code; sometimes questions are best answered with
cscope, sometimesgid, sometimesctags.ctagsis superb for integration intovim, butgidis frequently easier to script.