Skip to main content
edited tags
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257
Source Link
mkaito
  • 811
  • 7
  • 16

Template for new file

When opening a new file of certain types, I would like some boilerplate to be inserted. That is, when opening a buffer for a file that does not yet exist, insert some predefined text, optionally with some variable interpolation.

Things I can think of as use case:

  • Insert some license text at the start
  • Insert #IF_DEFINED_FOO_H directives in new C header files.
  • Insert some basic targets in a new Makefile