views:

66

answers:

2

I was wondering (if possible) if there was a program/tool/utility that when I create a new file and provide it with an extension that it creates the appropriate tags automatically?

For example, a new file I create called index.php would have the appropriate tags auto-generated inside:

<?php    
?>

I hope you get the idea.

Any information regarding this would be helpful.

+1  A: 

If you run Linux with GNOME, maybe http://tombuntu.com/index.php/2008/02/13/add-your-document-templates-to-gnome/ is what you need.

There is probably something similar in other environments.

Emil
Thanks for the response, I was looking for something more Windows based. It was tough for me to look since I couldn't find a good enough term to describe what I wanted to achieve. The link was very helpful, thank you again.
Anthony Forloney
+6  A: 

I don't know about a portable utility, but on Windows, there's a built-in feature that does it.

From regedit, go to your HKCR/.your-extension (e.g. HKCR/.php). the (Default) value will contain the filetype class - go to either HKCR/.your-extension/the-filetype-class or HKCR/the-filetype-class (either will do), then inside create a key named ShellNew. In the key, create a string value called FileName and assign to it the file path of your template file.

Now all new files with this particular extension will be created containing the contents of your template.

Here's a more detailed tutorial.

Max Shawabkeh
Max, I am absolutely infatuated with you.
Anthony Forloney
That's pretty cool. Does it work with just a few, select programs, or most of them will comply?
zneak
@Anthony: :) @zneak: It's a universal OS feature.
Max Shawabkeh
I even added "PHP script" to my New file menu, its amazing.
Anthony Forloney