将 PHP 扩展添加到 ctags
我正在尝试使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要找出当前的语言映射,请运行
ctags --verbose
。这将列出默认的语言映射,并且在输出的末尾可以从所有(可能的)配置文件中找到其他配置结果。至于您的个人配置文件:
~/.ctags
是默认文件。也可以在任何工作/项目目录中拥有本地配置文件 (./.ctags
)。找到 ctags 的工作命令行后,将这些附加参数逐行添加到首选配置文件中。这里有一些例子(包括jrwren的答案):
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):
确保您正在运行正确的 ctag。 OSX 附带 /usr/bin/ctags ,但它并不丰富。
我尝试了你写的内容,它与安装了 ctags 的brew 完美配合。
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.