ZeroBrane - How to create a template

82 Views Asked by At

Is it possible to create a template in ZeroBrane so that each time I create a new file, the template layout is used? This would be useful in LUA programming for Fibaro components as the same information (headers, file info (version, copyright, etc.)) would be on every file created.

Thanks for all and any help!

1

There are 1 best solutions below

0
On

Yes, you can create a simple plugin that adds new content using onEditorNew event. For example, try adding the following to the config file (user.lua):

package {
  onEditorNew = function(self, editor, event) editor:SetText("My template") end
}

You can also make it a proper plugin as described in the documentation.