From 891f416946868e86d19b87e6b811baad1c726290 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 10 Sep 2024 00:09:49 +0200 Subject: emacs: Properly configure tempel --- .config/emacs/init.el | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to '.config') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 8560128..37f315d 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -449,17 +449,15 @@ existing grammars." ;;; Snippet Support (use-package tempel :pin gnu + :custom + (tempel-trigger-prefix ",") + (tempel-path (expand-file-name "templates" x-config-directory)) :init - (customize-set-variable - 'tempel-path (expand-file-name "templates" x-config-directory)) - (push (cons tempel-path 'lisp-data-mode) auto-mode-alist)) - -(use-package eglot-tempel - :init - (with-eval-after-load 'eglot - (add-hook 'eglot-managed-mode-hook - (λ (unless (default-value eglot-tempel-mode) - (eglot-tempel-mode)))))) + (dolist (mode '(conf-mode prog-mode text-mode)) + (add-hook + (x-mode-to-hook mode) + (λ (add-hook 'completion-at-point-functions + #'tempel-complete -10 'local))))) ;;; Automatically Create Directories (defun x-auto-create-directories (original-function filename &rest arguments) -- cgit v1.2.3