Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
;; 一文字検索移動
;; 順方向
(defun move-forward-char (char)
(interactive "cMove to Char: ")
(if (eq (char-after (point)) char) (forward-char))
(and (search-forward (char-to-string char) nil t)
(backward-char)))
(defun move-forward-char-repeatable ()
(interactive)
(if (eq last-command this-command)
(command-execute 'previous-command)
(command-execute 'move-forward-char)))
;; 逆方向
(defun move-backward-char (char)
(interactive "cMove backward to Char: ")
(search-backward (char-to-string char) nil t))
(defun move-backward-char-repeatable ()
(interactive)
(if (eq last-command this-command)
(command-execute 'previous-command)
(command-execute 'move-backward-char)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.