Add :yas-minor-mode setting to feature/snippets
This commit is contained in:
parent
f22eeff763
commit
37946080e2
1 changed files with 15 additions and 0 deletions
|
@ -1,5 +1,20 @@
|
||||||
;;; feature/snippets/autoload/snippets.el -*- lexical-binding: t; -*-
|
;;; feature/snippets/autoload/snippets.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(def-setting! :yas-minor-mode (mode)
|
||||||
|
"Register a minor MODE with yasnippet so it can have its own snippets
|
||||||
|
category, if the folder exists."
|
||||||
|
(let* ((mode (doom-unquote mode))
|
||||||
|
(hookfn (intern (format "+snippets--register-%s" mode))))
|
||||||
|
`(after! yasnippet
|
||||||
|
(fset ',hookfn (lambda () (+snippets|enable-project-modes ',mode)))
|
||||||
|
(add-hook! ,mode #',hookfn))))
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Commands
|
||||||
|
;;
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +snippets/goto-start-of-field ()
|
(defun +snippets/goto-start-of-field ()
|
||||||
"Go to the beginning of the current field."
|
"Go to the beginning of the current field."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue