commit ac3c1b04623f7266ed4e78e74c82c898825cad15
parent a6cc357ac82402085758d980b8902ffe2c720708
Author: Anton Konyahin <me@konyahin.xyz>
Date: Tue, 9 May 2023 20:46:56 +0300
emacs: jump to next <++>
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
@@ -108,12 +108,12 @@
(define-key help-mode-map (kbd "n") 'next-line)
(define-key help-mode-map (kbd "p") 'previous-line)
-(defun knh-new-line-below ()
+(defun knh/new-line-below ()
"Insert new line below, without breaking current line"
(interactive)
(end-of-line)
(newline-and-indent))
-(global-set-key (kbd "C-c RET") 'knh-new-line-below)
+(global-set-key (kbd "C-c RET") 'knh/new-line-below)
;; borrowed from https://www.omarpolo.com/post/emacs-side-window.html
(defun op/buffer-to-side-window ()
@@ -127,6 +127,13 @@
(window-parameters . ((no-delete-other-windows t)))))
(delete-window)))
+(defun knh/next-input-mark ()
+ "Jump to next '<++>' and delete it."
+ (interactive)
+ (search-forward "<++>")
+ (delete-char -4))
+(global-set-key (kbd "C-c C-SPC") 'knh/next-input-mark)
+
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.