summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <thomas.voss@humanwave.nl> 2025-08-29 10:12:03 +0200
committerThomas Voss <thomas.voss@humanwave.nl> 2025-08-29 10:12:03 +0200
commitce7aa4eab58f4ed3da28eedda0bd2f6c0fe8cdff (patch)
tree821363ad01e8f758b739f2ad25600198eb817099
parent51ea25fec8d2fc9cd8f43ae32025fbe4a1caf0dc (diff)
emacs: Add temporary code for placeholders
-rw-r--r--.config/emacs/init.el22
1 files changed, 21 insertions, 1 deletions
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)