Fix embark, add tempel

This commit is contained in:
2026-01-21 17:37:44 +09:00
parent 672d44014f
commit 2b65287a62
4 changed files with 51 additions and 18 deletions

View File

@@ -168,17 +168,45 @@ control codes are not supported."
(indent-bars-treesit-wrap '((rust arguments parameters)))
:hook ((python-base-mode yaml-mode rust-mode) . indent-bars-mode))
;; Ellama allows using LLMs from emacs.
(use-package ellama
:ensure nil
:defer t
:bind ("C-c e" . ellama)
:init (setopt ellama-auto-scroll t)
:commands (ellama)
:config
;; show ellama context in header line in all buffers
(ellama-context-header-line-global-mode +1)
;; show ellama session id in header line in all buffers
(ellama-session-header-line-global-mode +1))
;; Configure Tempel
(use-package tempel
:bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
("M-*" . tempel-insert))
: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. 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))
;; Alternatively use `tempel-complete' if you want to see all matches. Use
;; a trigger prefix character in order to prevent Tempel from triggering
;; unexpectly.
;; (setq-local corfu-auto-trigger "/"
;; completion-at-point-functions
;; (cons (cape-capf-trigger #'tempel-complete ?/)
;; 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)
(setq tempel-path (concat minimal-emacs-user-directory "templates"))
;; 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)
;; (global-tempel-abbrev-mode)
)
;; Optional: Add tempel-collection if you want ready-made templates. Yes sir, I
;; do.
(use-package tempel-collection)
;;; 15-lsp.el end here