From 5d6f54aa9f03cc774c332060c7871b4bacb7717b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 23 Nov 2021 09:52:10 +0100 Subject: [PATCH] Create a function (and a binding) to jump to the next occurence of a character --- configuration.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configuration.org b/configuration.org index 397c5fd..c0f8f20 100644 --- a/configuration.org +++ b/configuration.org @@ -507,6 +507,17 @@ line first. Then jump to the actual end of the line." (org-end-of-line)))) #+END_SRC +*** 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) + (backward-char)))) +#+end_src + ** File manipulation *** Rename the current file @@ -3706,6 +3717,7 @@ With the new Transient package it will be easier. I just don’t 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)