Drupal Helper Textmate Bundle

|

Our custom Textmate Bundle (the rocking Mac OS X text editing tool) that we use in house to ease our typing during development. The bundle includes a number of tab trigger snippets. We know that it isn't complete with every hook, but we've just made them for the hooks we use most often. In future releases we will make be adding new shortcuts and as we do more Drupal 6 development we will be sure to release an updated version for 6.x!

More information about Textmate and Textmate Bundles.

Installation and Screencast

Download the attachment. Unzip the file. Double click the .tmbundle file and Textmate will take care of the rest. Next time you open up Textmate try out some of the tab triggers. NOTE: be sure to set the language type to HTML or PHP as shown in the screencast.

Drupal Helpers Textmate Bundle Screencast

Bundle Contents

Name Tab Trigger
Hooks
hook_block: Implementation of hook_block hook_block
hook_comment: Implementation of hook_comment hook_comment
hook_form_alter: Implementation of hook_form_alter hook_form_alter
hook_menu: Implementation of hook_menu hook_menu
hook_node_type: Implementation of hook_node_type hook_node_type
hook_nodeapi: Implementation of hook_nodeapi hook_nodeapi
hook_perm: Implementation of hook_perm hook_perm
hook_user: Implementation of hook_user hook_user
Function Short Cuts
drupal_set_message: Prints a message to drupal's messaging system. dsm
variable_del: Delete's a variable stored in Drupal's variable table. vdel
variable_get: Retrieves a variable stored in Drupal's variable table. vget
variable_set: Sets a variable stored in Drupal's variable table. vset
Stub Array Items
form: Creates a stub form array making it faster to type form_api elements. form
menu: Creates a stub menu item array making it faster to type hook_menu menu items. menu
AttachmentSize
Drupal Helpers 5_x.tmbundle.zip10.4 KB

I was under the impression

I was under the impression that all module hooks started with the module name.

Couldn't you save yourself some typing by having the snippets enter the module name for you? (ie. file.module would insert file_menu for your menu hook)

I was able to make this work by changing '${1:module_name}' to '${TM_FILENAME/.module//}'. It assumes that the file has a name ('Untitled' comes up empty), but I always start by building my core files anyway.

If I'm way out in left field, I'd love to hear why?

I also noticed that 'hook_comment' expands to 'module_name_compliment' which isn't what I think you inteneded.

Great bundle all around and exactly the kind of thing I've been looking for. Thanks for sharing.

And one more small

And one more small refinement.

'${1:${TM_FILENAME/\..*//}}' instead of '${TM_FILENAME/.module//}' retains your tab placeholder.

very interesting. i gotta

very interesting. i gotta try this one

this drupal stuff is really

this drupal stuff is really good.

drupal fastly improve its

drupal fastly improve its technology

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> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may use [inline:xx] tags to display uploaded files or images inline.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Upcoming events

  • No upcoming events available