Predefined pascal unit header template in Lazarus IDE lazarus / 9-Editor ---------------------------------------------------------------------- vladvons · 2013-11-02 08:19 1) When i create a new pascal unit i want to have at the begining of the unit some title like this: This title should be automatically generated by Lazarus IDE. It would be good to store own template into some Lazarus directory. { Company: My company name Author: Some author Creation date: 2013-11-02 GNU license text..... } 2) Now i have no header in over 300 units. Should i do this manually? When i share project sources worldwide i want to fill each unit title with headrer described above. is it possible some automation using Lazarus? ---------------------------------------------------------------------- Bart · 2013-11-02 11:31 You could easily write a simple app that does this for you. Bart ---------------------------------------------------------------------- Leledumbo · 2013-11-02 13:23 Indeed, a simple app could be made for that. The IDE currently doesn't have such a feature. ---------------------------------------------------------------------- howardpc · 2013-11-02 16:53 For current use you can write a simple 'boiler plate' template that inserts the information you want using the Ctrl-J shortcut. It involves adding a few appropriate lines to the lazarus.dci file. See here http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Templates Once you have done that it is available for all future projects as well. Retro-fitting existing .pas and .pp files with the additional lines would require a simple app to be written. ---------------------------------------------------------------------- vladvons · 2013-11-02 18:18 For big projects would be convenient to store own header template into lazarus directory. When user choose 'create new pascal unit/form/component' then Lazarus IDE creates it with predefined header template + usual code. Code: [Select]{ Company: My company name Author: Some author Creation date: 2013-11-02 GNU license text..... } unit Unit1; interface uses   Classes, SysUtils; implementation end. ---------------------------------------------------------------------- Leledumbo · 2013-11-03 03:56 QuoteFor big projects would be convenient to store own header template into lazarus directory. When user choose 'create new pascal unit/form/component' then Lazarus IDE creates it with predefined header template + usual code.Since the standard unit template is hardcoded in TFileDescPascalUnit.CreateSource, you'll need to create an IDE extension to automatically include the header (if you don't want to modify the source). ---------------------------------------------------------------------- Researching · 2018-11-28 23:05 [SOLVED: Laz.1.8.4 ] HOW TO: Modify the original “UNIT.pas” template: The template is hard-coded inside \lazarus\components\ideintf\projectintf.pas So open it, find: “TFileDescPascalUnit.CreateSource” Understand the code structure Modify to your wishes. My version of file: attached projectintf.pas