editor/snippets: load doom-snippets sooner

We want +snippets-dir to be first in yas-snippet-dirs. To ensure this,
doom-snippets should be loaded immediately before it is added to it, if
possible.
This commit is contained in:
Henrik Lissner 2019-07-14 22:46:16 +02:00
parent 2ff762b397
commit d12e7b831f
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -21,10 +21,12 @@
:config
(setq yas-verbosity (if doom-debug-mode 3 0)
yas-also-auto-indent-first-line t
yas-triggers-in-field nil ; disallow nested snippets
;; Remove default ~/.emacs.d/snippets
yas-snippet-dirs (delete yas--default-user-snippets-dir yas-snippet-dirs))
;; default snippets library, if available
(require 'doom-snippets nil t)
;; Allow private snippets in DOOMDIR/snippets
(add-to-list 'yas-snippet-dirs '+snippets-dir nil #'eq)
@ -63,10 +65,5 @@
[remap yas-visit-snippet-file] #'+snippets/edit))
;; `auto-yasnippet'
;;;###package auto-yasnippet
(setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
;; default snippets library
(def-package! doom-snippets
:after yasnippet)