diff options
author | Thomas Voss <thomas.voss@humanwave.nl> | 2025-08-29 10:12:03 +0200 |
---|---|---|
committer | Thomas Voss <thomas.voss@humanwave.nl> | 2025-08-29 10:12:03 +0200 |
commit | ce7aa4eab58f4ed3da28eedda0bd2f6c0fe8cdff (patch) | |
tree | 821363ad01e8f758b739f2ad25600198eb817099 /.config/emacs/init.el | |
parent | 51ea25fec8d2fc9cd8f43ae32025fbe4a1caf0dc (diff) |
emacs: Add temporary code for placeholders
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r-- | .config/emacs/init.el | 22 |
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) |