adding tempel

This commit is contained in:
Chris Cochrun 2022-03-08 10:57:16 -06:00
parent 11c902c909
commit 5493170045
3 changed files with 183 additions and 6 deletions

View file

@ -15,6 +15,7 @@
- [[#better-ui][Better UI]]
- [[#completion][Completion]]
- [[#yasnippet][YASnippet]]
- [[#tempel][Tempel]]
- [[#projectile][Projectile]]
- [[#httpd][HTTPD]]
- [[#navigation][Navigation]]
@ -755,6 +756,15 @@ Marginalia makes for some great decoration to our minibuffer completion items. W
#+end_src
Along with Marginalia, let's add in icons.
#+begin_src emacs-lisp
(use-package all-the-icons-completion
:after vertico
:config
(all-the-icons-completion-mode))
#+end_src
*** Embark
Embark or do something.
#+BEGIN_SRC emacs-lisp
@ -954,6 +964,38 @@ YASnippet is a templating system. It's powerful.
(yas-global-mode 1))
#+end_src
** Tempel
Tempel is another templating system. Also perhaps even more powerful with it's elisp way of creating snippets, but elisp is tougher to work around. But, I'll give it a try.
#+BEGIN_SRC emacs-lisp
(use-package tempel
:bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
("M-*" . tempel-insert)
("C-M-<return>" . tempel-done))
: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 Tempel will probably 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-complete
completion-at-point-functions)))
(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)
;; (tempel-global-abbrev-mode)
)
#+END_SRC
** Projectile
I'm going to use projectile to keep my projects inline.
#+begin_src emacs-lisp
@ -2294,13 +2336,14 @@ Let's use pdf-tools for a lot better interaction with pdfs.
#+begin_src emacs-lisp
(use-package pdf-tools
:straight (:host github
:repo "flatwhatson/pdf-tools"
:branch "fix-macros")
:repo "flatwhatson/pdf-tools"
:branch "fix-macros")
:defer 1
:config
(pdf-tools-install)
(custom-set-variables '(pdf-misc-print-program "/usr/bin/lpr")
'(pdf-misc-print-program-args (quote ("-o media=Letter" "-o fitplot")))))
'(pdf-misc-print-program-args (quote ("-o media=Letter" "-o fitplot"))))
(add-hook 'pdf-view-mode 'pdf-view-fit-page-to-window))
#+end_src
** EPUB