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

57
init.el
View file

@ -408,6 +408,11 @@
:config
(setq marginalia--cache-size 60000))
(use-package all-the-icons-completion
:after vertico
:config
(all-the-icons-completion-mode))
(use-package embark
:ensure t
:general
@ -569,6 +574,34 @@ targets."
(setq yas-snippet-dirs (list (expand-file-name "yasnippets/" user-emacs-directory)))
(yas-global-mode 1))
(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)
)
(use-package projectile
:defer t
:general
@ -1681,13 +1714,14 @@ If on a:
(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))
(use-package nov
:mode ("\\.epub\\'" . nov-mode)
@ -1950,3 +1984,20 @@ interfere with the default `bongo-playlist-buffer'."
gcmh-verbose nil))
(setq warning-suppress-types '((comp)))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(pdf-misc-print-program "/usr/bin/lpr" t)
'(pdf-misc-print-program-args '("-o media=Letter" "-o fitplot") t)
'(safe-local-variable-values
'((projectile-project-compilation-cmd . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build/ . && make --dir build/")
(projectile-project-compilation-cmd . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B buld/ . && make --dir build/")
(projectile-project-run-cmd . "./build/bin/presenter"))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)