Switch tempel back to yasnippet
This commit is contained in:
parent
2d48eab2d1
commit
3afd45755b
63
README.org
63
README.org
|
@ -830,7 +830,6 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package corfu
|
(use-package corfu
|
||||||
:ensure t
|
:ensure t
|
||||||
:after vertico
|
|
||||||
:custom
|
:custom
|
||||||
(corfu-cycle t)
|
(corfu-cycle t)
|
||||||
(corfu-auto t)
|
(corfu-auto t)
|
||||||
|
@ -838,7 +837,7 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
|
||||||
(corfu-quit-no-match 'separator)
|
(corfu-quit-no-match 'separator)
|
||||||
(corfu-quit-at-boundary 'separator)
|
(corfu-quit-at-boundary 'separator)
|
||||||
(corfu-preselect 'directory)
|
(corfu-preselect 'directory)
|
||||||
:bind (:map corfu-map
|
:bind ( :map corfu-map
|
||||||
("RET" . nil))
|
("RET" . nil))
|
||||||
:init
|
:init
|
||||||
(global-corfu-mode +1)
|
(global-corfu-mode +1)
|
||||||
|
@ -876,12 +875,10 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
|
||||||
|
|
||||||
(use-package cape
|
(use-package cape
|
||||||
:ensure t
|
:ensure t
|
||||||
:after corfu
|
:init
|
||||||
:config
|
|
||||||
(add-to-list 'completion-at-point-functions #'cape-file)
|
|
||||||
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
||||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
|
(add-to-list 'completion-at-point-functions #'cape-file)
|
||||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify))
|
(add-to-list 'completion-at-point-functions #'cape-elisp-block))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Consult
|
*** Consult
|
||||||
|
@ -905,9 +902,13 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
|
||||||
|
|
||||||
(use-package consult-eglot
|
(use-package consult-eglot
|
||||||
:ensure t
|
:ensure t
|
||||||
:after consult
|
:after (consult eglot)
|
||||||
:commands (consult-eglot-symbols)
|
|
||||||
:bind (("C-c s s" . consult-eglot-symbols)))
|
: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
|
#+end_src
|
||||||
|
|
||||||
*** Embark
|
*** Embark
|
||||||
|
@ -925,43 +926,19 @@ For reference information, see [[https://orgmode.com][Org-mode website]]
|
||||||
#+end_src
|
#+end_src
|
||||||
** Snippets
|
** Snippets
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; Configure Tempel
|
(use-package yasnippet
|
||||||
(use-package tempel
|
|
||||||
:ensure t
|
:ensure t
|
||||||
;; Require trigger prefix before template name when completing.
|
:hook ((prog-mode org-mode) . yas-minor-mode)
|
||||||
:custom
|
:config
|
||||||
(tempel-trigger-prefix "<")
|
(require 'yasnippet-snippets)
|
||||||
|
(yas-reload-all))
|
||||||
|
|
||||||
:bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
|
(use-package yasnippet-snippets :ensure t)
|
||||||
("M-*" . tempel-insert))
|
|
||||||
|
|
||||||
:init
|
(use-package yasnippet-capf
|
||||||
|
:ensure t
|
||||||
;; Setup completion at point
|
:after yasnippet
|
||||||
(defun tempel-setup-capf ()
|
:init (add-to-list 'completion-at-point-functions #'yasnippet-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)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** Aggressive Indent
|
** Aggressive Indent
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
Loading…
Reference in a new issue