From 6e20368b93d57efaa5aab7901ae436ddaccd156a Mon Sep 17 00:00:00 2001 From: Thomas Ulmer Date: Mon, 21 Jul 2025 09:44:06 -0700 Subject: tempel setup --- emacs/init.el | 11 +++-------- emacs/templates/c.eld | 5 +++++ 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 emacs/templates/c.eld diff --git a/emacs/init.el b/emacs/init.el index 7b9ab02..4feecf8 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -230,15 +230,10 @@ given keymap or in the global keymap." :demand t :custom (tempel-path "~/.emacs.d/templates/*.eld") - ;; (tempel-trigger-prefix "<") - :bind (("M-+" . tempel-complete)) - - ;; 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) - ) + :config + (keymap-set tempel-map " " #'tempel-next) + (keymap-set tempel-map " " #'tempel-previous)) (use-package dabbrev ; dynamic abbreviations :demand t diff --git a/emacs/templates/c.eld b/emacs/templates/c.eld new file mode 100644 index 0000000..fdb899f --- /dev/null +++ b/emacs/templates/c.eld @@ -0,0 +1,5 @@ + +c-mode + +(for > "for (" p "; " p "; " p ") {" n> (p "body;") n> "}") +(fori > "for (int i = 0; i < " p "; ++i) {" n> (p "body;") n> "}") -- cgit v1.2.3