minad / tempel

:classical_building: TempEl - Simple templates for Emacs
GNU General Public License v3.0
520 stars 27 forks source link

[Suggestion] add a function that combines tempel-complete/expand and tempel-next #91

Closed Ziqi-Yang closed 1 year ago

Ziqi-Yang commented 1 year ago

I find it somewhat awkward to use different keys to complete and move next. Though different keys enable nested template completion, it is a bit niggling. I'd prefer another function that combines tempel-complete / tempel-expand and tempel-next. Like:

(defun mk/tempel-complete-or-next ()
  (interactive)
  (if (not tempel--active)
    (call-interactively 'tempel-complete)
    (call-interactively 'tempel-next)))
minad commented 1 year ago

You can simply bind tempel-next in tempel-map to the same key as tempel-complete. The tempel-map is only active when Tempel is active so this should give you the desired effect.