Enable read-only-mode for built-in snippets

Because they shouldn't be edited out of ~/.emacs.d/.local -- if a
snippet in ~/.doom.d/snippets has the same name, built-in snippets will
be ignored.
This commit is contained in:
Henrik Lissner
2019-04-22 19:39:50 -04:00
parent c399c07694
commit a4f9eb6f6c
2 changed files with 10 additions and 0 deletions

View File

@ -45,6 +45,9 @@
;; tell smartparens overlays not to interfere with yasnippet keybinds
(advice-add #'yas-expand :before #'sp-remove-active-pair-overlay))
;; Enable `read-only-mode' for built-in snippets (in `doom-local-dir')
(add-hook 'snippet-mode-hook #'+snippets|read-only-maybe)
(when (featurep! :editor evil)
;; evil visual-mode integration for `yas-insert-snippet'
(define-key yas-minor-mode-map [remap yas-insert-snippet] #'+snippets/expand-on-region)))