SublimeText/CTags — Issue #15: Tags only generated for .php files
Author: drewish
Created: 2011-12-08 00:36:33+00:00
State: open

First off thanks for this. It's removed my only gripe about ST2.

I've been working on Drupal (which is written in PHP) and couldn't figure out why the tags weren't getting generated correctly. Eventually I came across a blog post (http://openflows.com/blog/mvc/2009/01/27/using-exuberant-ctags-drupal) that gave me the clue. By default ctags only reads .php files but Drupal uses several custom extensions. By editing CTags.sublime-settings and changing the ctags_command command to include the --langmap option:

"ctags_command" : "/opt/local/bin/ctags -R --langmap=php:.engine.inc.module.theme.php --php-kinds=cdfi",

I was able to get it working. If there's a better way to provide this option I'd love to know what it is. In either case it seems like it'd be a nice thing to document.