summaryrefslogtreecommitdiffstats
path: root/lisp/bandali-yasnippet.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/bandali-yasnippet.el')
-rw-r--r--lisp/bandali-yasnippet.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/lisp/bandali-yasnippet.el b/lisp/bandali-yasnippet.el
new file mode 100644
index 0000000..6cdbc7a
--- /dev/null
+++ b/lisp/bandali-yasnippet.el
@@ -0,0 +1,26 @@
+(use-package yasnippet
+ :defer 0.6
+ :config
+ (declare-function yas-reload-all
+ "yasnippet" (&optional no-jit interactive))
+ (declare-function yas-maybe-expand-abbrev-key-filter
+ "yasnippet" (cmd))
+
+ (defconst yas-verbosity-cur yas-verbosity)
+ (setq yas-verbosity 2)
+ (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t)
+ (yas-reload-all)
+ (setq yas-verbosity yas-verbosity-cur)
+
+ (defun b/yas-maybe-expand-abbrev-key-filter (cmd)
+ (when (and (yas-maybe-expand-abbrev-key-filter cmd)
+ (not (bound-and-true-p git-commit-mode)))
+ cmd))
+ (defconst b/yas-maybe-expand
+ '(menu-item "" yas-expand :filter b/yas-maybe-expand-abbrev-key-filter))
+ (define-key yas-minor-mode-map
+ (kbd "SPC") b/yas-maybe-expand)
+
+ (yas-global-mode))
+
+(provide 'bandali-yasnippet)