mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Fix unindexed file-templates on first load of yasnippet
This commit is contained in:
@ -11,13 +11,12 @@
|
||||
:init
|
||||
(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)
|
||||
|
@ -11,6 +11,8 @@
|
||||
(defvar yas-minor-mode-map (make-sparse-keymap))
|
||||
|
||||
:init
|
||||
(setq yas-snippet-dirs '(yas-installed-snippets-dir))
|
||||
|
||||
;; Ensure `yas-reload-all' is called as late as possible. Other modules could
|
||||
;; have additional configuration for yasnippet. For example, file-templates.
|
||||
(add-transient-hook! 'yas-minor-mode-hook (yas-reload-all))
|
||||
@ -23,7 +25,6 @@
|
||||
yas-indent-line 'auto
|
||||
yas-also-auto-indent-first-line t
|
||||
yas-prompt-functions '(yas-completing-prompt yas-ido-prompt yas-no-prompt)
|
||||
yas-snippet-dirs '(yas-installed-snippets-dir)
|
||||
yas-use-menu nil
|
||||
;; Allow nested snippets
|
||||
yas-triggers-in-field t)
|
||||
|
Reference in New Issue
Block a user