summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2025-07-21 09:44:06 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2025-07-21 09:44:06 -0700
commit6e20368b93d57efaa5aab7901ae436ddaccd156a (patch)
tree80dd7fc8fdb9c2b66710f3ac55791ab7573329e0 /emacs
parentb1d79734cdd878bde098a18a9af77b241cd7afa8 (diff)
tempel setup
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el11
-rw-r--r--emacs/templates/c.eld5
2 files changed, 8 insertions, 8 deletions
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 "<remap> <forward-word>" #'tempel-next)
+ (keymap-set tempel-map "<remap> <backward-word>" #'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> "}")