From ce7aa4eab58f4ed3da28eedda0bd2f6c0fe8cdff Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 29 Aug 2025 10:12:03 +0200 Subject: emacs: Add temporary code for placeholders --- .config/emacs/init.el | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to '.config') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index aa3033c..97525f1 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -318,10 +318,30 @@ the buffer without saving it." (when mm-lsp-p (require 'mm-lsp)) ; Language Server Protocol +;; TODO: Put this somewhere reasonable + +(defvar mm-placeholder-text "‹XX›") + +(defun mm-placeholder-insert () + (interactive) + (insert mm-placeholder-text)) + +(defun mm-placeholder-next () + (interactive) + (let ((point (point))) + (if (search-forward mm-placeholder-text nil :noerror) + (delete-region (match-beginning 0) (match-end 0)) + (goto-char point) + (message "No more placeholders after point.")))) + +(keymap-global-set "C-c i p" #'mm-placeholder-insert) +(keymap-global-set "C-c n" #'mm-placeholder-next) + + ;;; Postamble (add-hook 'after-init-hook (defun mm-echo-init-time () (message (emacs-init-time "Emacs initialized in %.2f seconds"))) - 100) \ No newline at end of file + 100) -- cgit v1.2.3