This module adds file templates for blank files, powered by doom-package:yasnippet.
- @hlissner
Become a maintainer?
This module has no flags.
This module doesn’t install any packages.
- doom-package:yasnippet
This module does not have a changelog yet.
Enable this module in your doom!
block.
This module has no external requirements.
🔨 This module’s usage documentation is incomplete. Complete it?
File templates are automatically expanded when opening empty files who match one
of the rules in the +file-templates-alist
variable.
These templates are simply yasnippet snippets, which can also be expanded by
typing their trigger and pressing TAB. By convention, the triggers for file
templates are prefixed with two underscores __
(the trigger for the default
file template of a major mode is almost always __
).
A special command is available for inserting software licenses: M-x
+file-templates/insert-license
.
📌 Licenses with a
-bp
suffix are boilerplate templates; i.e. shorter versions intended for comment headers in code files.
🔨 This module’s configuration documentation is incomplete. Complete it?
New file templates can be added to
$DOOMDIR/snippets/{major-mode}/{snippet-name}
. The yasnippet documentation
covers how to write a snippet. You can map a snippet to a file path, major mode,
or another arbitrary predicate using fn:set-file-template!.
Look into its documentation with <help> f set-file-template\!.
Add snippet files to $DOOMDIR/snippets/text-mode/
with the __licenses-
prefix and fn:+file-templates/insert-license will recognize them. E.g.
$DOOMDIR/snippets/text-mode/__license-mit
.
- If a file template isn’t expanding where you expect it to, run
M-x +file-templates/debug
. This will report to you what file template rule would apply for the correct file.
This module has no FAQs yet. Ask one?
🔨 This module’s appendix is incomplete. Write more?
set-file-template! PRED &rest PLIST
set-file-templates! &rest TEMPLATES
+file-templates/insert-license
+file-templates/debug
+file-templates-dir
+file-templates-default-trigger
+file-templates-alist