Create a function (and a binding) to jump to the next occurence of a character

This commit is contained in:
Gergely Polonkai 2021-11-23 09:52:10 +01:00
parent 373914e084
commit 5d6f54aa9f
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4
1 changed files with 12 additions and 0 deletions

View File

@ -507,6 +507,17 @@ line first. Then jump to the actual end of the line."
*** Move to the next occurence of a character within the same line
#+begin_src emacs-lisp
(defun goto-next-char (chr)
(interactive "c")
(let ((substr (char-to-string chr))
(end (save-excursion (end-of-line) (point))))
(when (search-forward substr end t)
** File manipulation
*** Rename the current file
@ -3706,6 +3717,7 @@ With the new Transient package it will be easier. I just dont know how to us
("C-M-r" . isearch-backward)
("C-~" . toggle-char-case)
("C-z" . nil)
("M-g SPC" . goto-next-char)
:map ctl-x-map
("C-y" . gpolonkai/duplicate-line)
("_" . maximize-window)