Switch tempel back to yasnippet

This commit is contained in:
Evie Litherland-Smith 2023-12-21 12:17:08 +00:00
parent 2d48eab2d1
commit 3afd45755b

View file

@ -830,7 +830,6 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
#+begin_src emacs-lisp
(use-package corfu
:ensure t
:after vertico
:custom
(corfu-cycle t)
(corfu-auto t)
@ -876,12 +875,10 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
(use-package cape
:ensure t
:after corfu
:config
(add-to-list 'completion-at-point-functions #'cape-file)
:init
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify))
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-elisp-block))
#+end_src
*** Consult
@ -905,9 +902,13 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
(use-package consult-eglot
:ensure t
:after consult
:commands (consult-eglot-symbols)
:after (consult eglot)
:bind (("C-c s s" . consult-eglot-symbols)))
(use-package consult-yasnippet
:ensure t
:after (consult yasnippet)
:bind (("C-c s y" . consult-yasnippet)))
#+end_src
*** Embark
@ -925,43 +926,19 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
#+end_src
** Snippets
#+begin_src emacs-lisp
;; Configure Tempel
(use-package tempel
(use-package yasnippet
:ensure t
;; Require trigger prefix before template name when completing.
:custom
(tempel-trigger-prefix "<")
:hook ((prog-mode org-mode) . yas-minor-mode)
:config
(require 'yasnippet-snippets)
(yas-reload-all))
:bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
("M-*" . tempel-insert))
(use-package yasnippet-snippets :ensure t)
:init
;; Setup completion at point
(defun tempel-setup-capf ()
;; Add the Tempel Capf to `completion-at-point-functions'.
;; `tempel-expand' only triggers on exact matches. Alternatively use
;; `tempel-complete' if you want to see all matches, but then you
;; should also configure `tempel-trigger-prefix', such that Tempel
;; does not trigger too often when you don't expect it. NOTE: We add
;; `tempel-expand' *before* the main programming mode Capf, such
;; that it will be tried first.
(setq-local completion-at-point-functions
(cons #'tempel-expand
completion-at-point-functions)))
(add-hook 'conf-mode-hook 'tempel-setup-capf)
(add-hook 'prog-mode-hook 'tempel-setup-capf)
(add-hook 'text-mode-hook 'tempel-setup-capf)
;; Optionally make the Tempel templates available to Abbrev,
;; either locally or globally. `expand-abbrev' is bound to C-x '.
(add-hook 'prog-mode-hook #'tempel-abbrev-mode))
;; Optional: Add tempel-collection.
;; The package is young and doesn't have comprehensive coverage.
(use-package tempel-collection
:ensure t)
(use-package yasnippet-capf
:ensure t
:after yasnippet
:init (add-to-list 'completion-at-point-functions #'yasnippet-capf))
#+end_src
** Aggressive Indent
#+begin_src emacs-lisp