This is a feature proposal which would improve the first experience with Godot for new useres.
I think it would be a really great feature if you could choose between different templates when you create a new GDscript. Like in blender where you can choose between many basic script structures: for example "Gamelogic module", "UI simple"...
The default template (func _ready(): ...) should stay of course.
This could be embedded into the create new script dialog box like so:

There should be a lot of, unnecessary examples with too many comments (that sound strange ;). This should help beginners to get their interactive "game" up and running in about 2 min with no experience! And if there is a big catalog of small to 50 line templates than also experienced unseres can learn from it (especially when there are a lot of comments).
In addition to beginnerfrendliness this can speed up some peoples work speed with scripts like: "W,A,S,D 3Drigid body controller" or "3D fps camera only".
A general custom template system could be pretty useful, not only for this, but for more advanced usage, when one has a bunch of boilerplate code or loading of internal libraries that gets annoying to repeat every new script.
It would be nice if more templates can be added via addons/plugins.
Or just be putting in something like *.gdt files in a special directory (adjacent to the exports for example on the file system?), where gdt files are just gd with certain special constructs to allow textural replacement. Mustache is a popular C/C++ templating system to handle such uses that would be easy to embed into Godot, especially thanks to its licence and tiny size.
I like in editor settings and .gdt approach rather than addons/plugins approach. Former has a feeling of being "unofficial and less supported". Plugins and Addons need a longer time to prove their reliability to community I think.
But how many templates the dropdown menu could be used without being UI unfriendly? Just wondering if instead of a dropdown, a search-file button (like in the "path" selection) is better - then you can expand the number of templates easily by adding a .gdt in the templates folder. The only problem is where this template folder would be, I guess.
Should be an extension of the existing AssetLib functionality.
If the dropdown could contain a sorted list with a search at the top and categories then that would probably be the best for usability. That would be similar to how the UE4 IDE works.
I started implementing this.
So far, like in the current default template, there's only one "placeholder". That's %BASE%, used for extending the base class.
What other placeholders would you want to use in script templates?
@Hinsbart there is also the class name placeholder. GDScript doesn't need it, but the scripting API supports languages that do (bool ScriptLanguage::has_named_classes()).
Project_Name, Author, Current_Date, Email_Address, License_Summary placeholders are ones that I use frequently. I Also use File_Name, File_Path but not sure if these are useful for a Godot project.
@Hinsbart Is this still in progress.
I think the nicer approach would be to have a folder In .godot where you can add multiple .gd files which than get listed as templates. On installation there can be:
This feature would be great because it also solves: #5711
@toger5 yes, that's actually how I implemented it ^^
But even if you can easily add your own templates it'd still be nice to be able to use some placeholders IMO.
Anyway, I guess I'll just PR it the way it is now. Then we can think about how to further improve it afterwards.
@Hinsbart this is amazing! Yea I think just making a pr for now and than discussing it or merging it and adding onto it is great
@toger5 Done
Done as #9158.
Most helpful comment
Or just be putting in something like *.gdt files in a special directory (adjacent to the exports for example on the file system?), where gdt files are just gd with certain special constructs to allow textural replacement. Mustache is a popular C/C++ templating system to handle such uses that would be easy to embed into Godot, especially thanks to its licence and tiny size.