Rudy’s OBTF Rudolf Adamkovič

Home / Emacs / TempEl


Configure

Install the package.

(with-eval-after-load 'package
  (add-to-list 'package-selected-packages 'tempel))

Complete globally on C-M-<tab>.

Note. The officially recommended binding is M-+.

(keymap-global-set "C-M-<tab>" #'tempel-complete)

Move between placeholders with TAB and S-TAB.

Note. The official bindings are M-{ and M-}.

(with-eval-after-load 'tempel
   (keymap-set tempel-map "TAB" #'tempel-next)
   (keymap-set tempel-map "S-TAB" #'tempel-previous))

Find the templates in the *-templates.* files in the org-directory.

(with-eval-after-load 'tempel
  (setopt tempel-path
          (file-name-concat (progn
                              (require 'org)
                              org-directory)
                            "obtf.eld")))

Create a template for defining new templates. Meta!

org-mode
(template
 "#+begin_src lisp-data :tangle "
 (concat (file-name-base buffer-file-name) "-templates.eld") n
 (p "MODE") "-mode" n
 "(" (p "NAME") n "  " q ")" n
 "#+end_src")

© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.