Home

Updated Drupal TextMate Bundle

Jan 14, 2007

I've updated my Drupal TextMate bundle script to also generate snippets for all PHP internal functions, including correct placeholders for the function arguments. It's a lifesaver when navigating PHP's bizarre Array or String APIs.

The script fetches the PHP function list straight from PHP CVS, but it still needs a Drupal tree to work. You can also copy in the contrib documentation to get snippets for hooks too (which even auto-fill in the module name). All PHP files within the given path are parsed.

To use it, place it in ~/Library/Application Support/TextMate/Bundles and run it:

php generate.php.txt [path to drupal]

In TextMate, go to Bundles › Bundle Editor › Reload Bundles to activate it.

(License: GPL)

AttachmentSize
generate.php.txt3.99 KB

Awesome update! Very, very

Jan 14, 2007 ted

Awesome update! Very, very useful, beats running to api.drupal.org :-)

Quirks

Jan 20, 2007 naquah

There are two small 'quirks':

  • the snippets for functions like node_save(&$node) and taxonomy_term_count_nodes($tid, $type = 0) do not work correctly, when 'tabbing' through them only the $node (without the &) and $type (without the = 0) parts are selected;
  • your script appears to build a file called autocompletions.txt in the bundle, but I don't believe TextMate does anything with this file. I think completions should go in Drupal.tmbundle/Preferences/Completions.plist.

If you'd fix that, the script would be perfect! Thanks.

Sweet, but..

Feb 01, 2007 Anonymous

Any hints for how I can get color syntax highlighting in .module and .install files?

The bundle is very sweet, love to have such quick access to all the functions of my particular Drupal installation. Thanks!

Multiple Drupal versions?

Mar 24, 2007 Sheldon Rampton

Suppose I want to create multiple bundles for different versions of Drupal: one for 4.6, 4.7, 5.x. Is there a way to do that?

Versions

Mar 24, 2007 Steven

Well, you can generate a bundle for each Drupal version just by renaming the result, but I don't think they would actually work together. There's no easy way to tell which version of Drupal you're coding against anyway. You could swap out the bundles though.

Would be ingenious if you

Jun 18, 2007 Peter

Would be ingenious if you could make it stick things into categories, for instance based on folders or on prefix. The way things are now, the list if awfully long. Not to mention that the keyboard shortcuts could be based on prefix

examples of keyboard shortcuts:
db ->
list all db functions

taxonomy->
list all taxonomy functions

example of how the menu can be arranged:
-database
--db_query
--db_rewrite_sql
...
-modules
--node
---node_load
---node_access
...
--taxonomy
---taxonomy_get_tree
...

How about a bundle to lookup

Aug 13, 2007 dvessel

How about a bundle to lookup api.drupal.org for the selected function.
Check the .info file, get version and do the lookup for the appropriate version.

That would truly rock!

permission to reuse and republish?

Apr 05, 2008 jpoesen

Hi. Many thanks for posting and updating this.

I'd like to adapt the code so it generates an xml variation that's usable for another editor. Am I allowed to create this derived work and republish, giving proper credit?

Thanks.
J.

GPL

Apr 05, 2008 Steven

I just added a GPL license notice. Feel free to.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul> <img> <em> <p> <br> <span> <div> <h2> <h3> <abbr> <small> <table> <tr> <td> <strong> <acronym> <th> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Recent comments

Images