ActiveState Community

Comments in php

Posted by deepbluegene on 2009-01-31 20:20

Hi I am using Komodo Edit, version 5.0.3, build 2767, platform win32-x86.

i have very small issue. usually when i start comments in php in aptana studio i just press /* and enter, aptana automatically do the rest as
/*
* my comment here
*/

is it possible in komodo also?

thanks

ericp | Tue, 2009-02-03 10:42

You could instead write a snippet. Komodo even ships
a snippet called 'com' in [Toolbox|Abbreviations|PHP].

Here's how it works:

In a PHP file, type "com" and press Ctrl-T. This
expands to

/**
  *  [|] 
  */

with the cursor position marked as "[|]". You can
easily modify the code that gets inserted -- see
http://community.activestate.com/forum/keyboard-templates
for some more details.

If you really want to do this on return, not ctrl-T,
you could write a macro with an eventListener that
watches for the return key in that context, and overrides
Komodo's standard behaviour when it finds the start
of a comment. You could make this macro a startup-trigger,
so it would always be in place when you're running Komodo.

Hope this helps,

Eric

deepbluegene | Tue, 2009-02-03 18:36

Thanks for the reply.

I did not knew that. I can live with ctrl-T. I never checked that samples.now i feel stupid about that. but you gave me new direction.now i am going to explore it and develop my own as well.

thanks again. you saved me some typing.

deepbluegene | Tue, 2009-02-03 19:12

i have added couple of new snippets.

Thanks for the help. I really appreciate that. now i see endless possibilities as there are so many repetitive tasks which now i can add as snippets.

ericp | Wed, 2009-02-04 10:25

If you come up with any way cool snippets, feel free to
post them here, or at the macros-and-extensions forum:
http://community.activestate.com/forums/komodo-extensions

- Eric