[Lazarus] Modifying the "File -> New Unit" template

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Tue Apr 11 13:02:05 CEST 2017


On 2017-04-11 11:46, Mattias Gaertner via Lazarus wrote:
> Right click in the IDE coolbar on the "New unit" button to select
> another template.

I meant I want to modify the code that Lazarus IDE gives once I click
“File -> New Unit”. I don't want a completely different template. eg:
this is the default I see now...

====================
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

implementation

end.
===================

I want to change that so the default has difference uses clauses,
defines the text encoding of the source file etc. Where does the above
code come from? Hard-coded?

eg:
  MSEide has a ‘templates’ folder where all such auto-generated code is
  defined. Nothing is hard-coded in the MSEide executable. From your
  answer I assume Lazarus doesn’t do anything like this, and instead
  hard-codes such default unit templates. :-/


> A package can register other templates.

I'll wait on your reply before I delve into this.


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list