spacemacs/layers/+completion/templates
syl20bnr 6220ace290 core: rework environment variables and PATH management
See updated DOCUMENTATION.org and FAQ.org for more info.

* add core-env.el
* add library load-env-vars.el
* add bootstrap package dotenv-mode.el
* remove spacemacs-environment from bootstrap layer
* remove dotspacemacs variable dotspacemacs-import-env-vars-from-shell
* remove dotspacemacs variable dotspacemacs-improt-env-vars-shell-file-name
* add new key binding SPC f e e to open spacemacs.env file
* add new key binding SPC f e E to reload environment variable from env file
* add new key binding SPC f e C-e to re-initialize the env file from shell.
2018-06-25 02:55:28 -04:00
..
README.org Fix typo in README.org 2018-05-27 20:02:00 +03:00
config.el core: rework environment variables and PATH management 2018-06-25 02:55:28 -04:00
packages.el templates: look for dotspacemacs-directory location first 2018-05-23 00:21:32 -04:00

README.org

Templates layer

Description

This layer provides templates to Spacemacs. A template consists of text that is automatically inserted into a new file when it is opened. This is done via yatemplate, which leverages yasnippet.

Features:

  • Auto-insert snippets when creating specific new files.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add templates to the existing dotspacemacs-configuration-layers list in this file.

Configuration

Drop your templates in ~/.emacs.d/private/templates or ~/.spacemacs.d/templates depending on which method you are using.

You can also specify a different location with templates-private-directory:

  (setq-default dotspacemacs-configuration-layers
    '((templates :variables templates-private-directory "~/mytemplates")))

Each file in this directory must be of the form XXX:regexp where regexp is a regular expression that will be matched against filenames. The prefix XXX can be used to enforce an ordering (templates that come first will have priority). It is not part of the final regexp. Therefore, more specific templates should come first. For example,

00:test_.*.py
01:.*.py

See the yatemplate documentation for specifics. Full yasnippet syntax is supported, so consult the yasnippet documentation for details.

Default insertions

Note that Emacs ships with some default templates. If these are not to your liking, set the layer variable templates-use-defaults to nil.

  (setq-default dotspacemacs-configuration-layers
    '((templates :variables templates-use-defaults nil)))

Querying

To disable the automatic querying each time a new file is opened, set auto-insert-query to nil.

  (setq auto-insert-query nil)