feature/file-templates: minor refactor
This commit is contained in:
parent
5ff9849b39
commit
be2f0a043d
1 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
(defvar +file-templates-dir
|
(defvar +file-templates-dir
|
||||||
(expand-file-name "templates/" (file-name-directory load-file-name))
|
(expand-file-name "templates/" (file-name-directory load-file-name))
|
||||||
"")
|
"The path to a directory of yasnippet folders to use for file templates.")
|
||||||
|
|
||||||
(def-package! autoinsert ; built-in
|
(def-package! autoinsert ; built-in
|
||||||
:defer 1
|
:defer 1
|
||||||
|
@ -12,12 +12,12 @@
|
||||||
(setq auto-insert-query nil ; Don't prompt before insertion
|
(setq auto-insert-query nil ; Don't prompt before insertion
|
||||||
auto-insert-alist nil) ; Tabula rasa
|
auto-insert-alist nil) ; Tabula rasa
|
||||||
|
|
||||||
(after! yasnippet
|
|
||||||
(push '+file-templates-dir yas-snippet-dirs))
|
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(auto-insert-mode 1)
|
(auto-insert-mode 1)
|
||||||
|
|
||||||
|
(after! yasnippet
|
||||||
|
(push '+file-templates-dir yas-snippet-dirs))
|
||||||
|
|
||||||
(defun +file-templates--expand (key &optional mode project-only)
|
(defun +file-templates--expand (key &optional mode project-only)
|
||||||
"Auto insert a snippet of yasnippet into new file."
|
"Auto insert a snippet of yasnippet into new file."
|
||||||
(when (if project-only (doom-project-p) t)
|
(when (if project-only (doom-project-p) t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue