Write core initfiles + defuns
This commit is contained in:
parent
c0661f5293
commit
b998f4ab08
52 changed files with 2444 additions and 706 deletions
18
core/lib/macros-auto-insert.el
Normal file
18
core/lib/macros-auto-insert.el
Normal file
|
@ -0,0 +1,18 @@
|
|||
;;; macros-auto-insert.el
|
||||
;; for ../core-auto-insert.el
|
||||
|
||||
;;;###autoload
|
||||
(defmacro add-template! (regexp-or-major-mode uuid yas-mode &optional project-only)
|
||||
`(define-auto-insert ,regexp-or-major-mode
|
||||
(lambda ()
|
||||
(unless (or (and ,project-only (not (narf/project-p)))
|
||||
(not (or (eq major-mode ,yas-mode)
|
||||
(symbol-value ,yas-mode))))
|
||||
(insert ,uuid)
|
||||
(yas-expand-from-trigger-key)
|
||||
(if (string-equal ,uuid (s-trim (buffer-string)))
|
||||
(erase-buffer)
|
||||
(evil-insert-state 1))))))
|
||||
|
||||
(provide 'macros-auto-insert)
|
||||
;;; macros-auto-insert.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue