mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
feature/file-templates: minor refactor
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
|
||||
(defvar +file-templates-dir
|
||||
(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
|
||||
:defer 1
|
||||
@ -12,12 +12,12 @@
|
||||
(setq auto-insert-query nil ; Don't prompt before insertion
|
||||
auto-insert-alist nil) ; Tabula rasa
|
||||
|
||||
(after! yasnippet
|
||||
(push '+file-templates-dir yas-snippet-dirs))
|
||||
|
||||
:config
|
||||
(auto-insert-mode 1)
|
||||
|
||||
(after! yasnippet
|
||||
(push '+file-templates-dir yas-snippet-dirs))
|
||||
|
||||
(defun +file-templates--expand (key &optional mode project-only)
|
||||
"Auto insert a snippet of yasnippet into new file."
|
||||
(when (if project-only (doom-project-p) t)
|
||||
|
Reference in New Issue
Block a user