Question about : license headers in Komodo

Hello,

When i create anew project i usually put some copy right on the header of the file like this

<?php /** * COYPY RIGHT * Some thinng here ..... */ My question is in komodo have any method to auto put this every single time i create a new file ? I'm using komodo 10.*

The easiest way to do this is to use you’re custom templates.
Create a php file with you’re copyright piece and use the save As Other > Template option:

When you then use the open New File From Template function, you can access you’re custom template under My Templates:

Or you can use snippets.

And add a hotkey for it! :slight_smile:

Yeah or use auto abbreviations, or commando, or just use the toolbox, or …

So many ways to use toolbox items :slight_smile:

The OP said he wanted to add the header automatically every time he creates new files. As far as I’m aware, only @babobski’s solution works. Can snippets insert stuff automatically every time a new file is created?

@babobski’s answer doesnt directly address his use-case either as it requires extra steps to create a file, as such having alternative solutions that somewhat address the same use-case is only helpful.

There’s a way to insert snippets from userscripts, and there’s a way to automatically run userscripts on file opening event. To insert a snippet only in certain types of files, there’s a way to get current language of the buffer.

Of course you can program the logic you want, I think @drakele was asking for tools that are already in the IDE though.

1 Like

Yes i know about some method that listed above but i asking for a tools already existed in komodo that will automaticaly add the liecense header when i create new file and auto mactic change the liecense of all file when i make change.

I’m not aware of any such tools. We are planning an overhaul to the template system though, making it easier to use.