szablon

A work in progress editorconfig inspired cross-editor standard for per-project file templates.


.szablon/szablon.ini

This is the szablon configuration, always located at that path. You can define variables that can call a shell, as well as templates. Templates take a path glob to match files as the key and the template file as the value.

+
.szablon/header.sz

This is a template file. It can use variables from the config, as well as a few special utility variables. It can also call a shell! Config variables are passed to each shell's environment. The regex variable allows you to later match that part of the file against your pattern. Everything outside of @{} receives no special treatment.

+
.szablon/guard.sh

You can also call scripts or use any other files. $PWD of szablon is the .szablon/ directory of your project. All paths that are not absolute are relative to that directory. Keep that in mind when writing scripts!

=
include/ptk.h

This is the output file! All variables are replaced with their value and your cursor is moved to the position defined in the template. The regex defined earlier allows you to check if it conforms to its template, even after editing the file.