将 PHP 扩展添加到 ctags

发布于 2024-12-22 04:52:20 字数 292 浏览 1 评论 0原文

我正在尝试使用 ctags 添加“.inc”作为 PHP 的扩展名。我一定是误解了手册中的某些内容。在我尝试添加扩展程序时,我正在运行:

ctags --langmap=PHP:+.inc

给出的响应是:

ctags: No files specified. Try "ctags --help".

我缺少什么?我需要指定一些配置文件吗?仅供参考,我在 Mac OS X 10.7.2 上运行 Exuberant Ctags 5.8。

I'm trying to add ".inc" as an extension for PHP with ctags. I must be misinterpretting something in the manual. In my attempts to add the extension, I am running:

ctags --langmap=PHP:+.inc

The response given is:

ctags: No files specified. Try "ctags --help".

What am I missing? Do I need to specify some config file? FYi, I am running Exuberant Ctags 5.8 on Mac OS X 10.7.2.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挽你眉间 2024-12-29 04:52:20

要找出当前的语言映射,请运行 ctags --verbose。这将列出默认的语言映射,并且在输出的末尾可以从所有(可能的)配置文件中找到其他配置结果。

至于您的个人配置文件:~/.ctags 是默认文件。也可以在任何工作/项目目录中拥有本地配置文件 (./.ctags)。

找到 ctags 的工作命令行后,将这些附加参数逐行添加到首选配置文件中。这里有一些例子(包括jrwren的答案):

--langmap=PHP:+.inc.module
--langmap=Sh:+.csh

To find out the current language-mappings, run ctags --verbose. This will list the default language-mappings and at the end of the output one can find additional configuration-results from all (possible) config-files.

As for your personal config-file: ~/.ctags is the default one. It is also possible to have local config-files (./.ctags) in any working/project-directory.

Once a working command-line for ctags was found, add those additional parameters line by line to the preferred config-file. Here some example (including the answer from jrwren):

--langmap=PHP:+.inc.module
--langmap=Sh:+.csh
淡淡绿茶香 2024-12-29 04:52:20

确保您正在运行正确的 ctag。 OSX 附带 /usr/bin/ctags ,但它并不丰富。

我尝试了你写的内容,它与安装了 ctags 的brew 完美配合。

/usr/local/bin/ctags -R --langmap=PHP:+.inc .

Make sure you are running the right ctags. OSX ships with /usr/bin/ctags which is NOT Exuberant.

I tried what you wrote and it worked perfectly with a brew installed ctags.

/usr/local/bin/ctags -R --langmap=PHP:+.inc .
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文