From 5e1bd7ce394c84049da8afe66fed8db9fcf94282 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 9 Mar 2021 17:54:32 +0100 Subject: [PATCH] Update C-s experience C-s now starts swiper, while C-r starts isearch regex forward/backward based on prefix. --- configuration.org | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/configuration.org b/configuration.org index b8c5790..9f272ea 100644 --- a/configuration.org +++ b/configuration.org @@ -3584,6 +3584,16 @@ With the new Transient package it will be easier. I just don’t know how to us ** The actual key bindings +#+begin_src emacs-lisp +(defun gpolonkai/isearch-regexp (prefix) + "Call `isearch-forward-regex'. If PREFIX is non-nil, call `isearch-backward-regex' instead." + (interactive "P") + (call-interactively + (if prefix + 'isearch-backward-regexp + 'isearch-forward-regexp))) +#+end_src + #+BEGIN_SRC emacs-lisp (bind-keys :map global-map @@ -3602,8 +3612,8 @@ With the new Transient package it will be easier. I just don’t know how to us ("C-e" . gpolonkai/move-to-end-of-line) ("M-q" . sachachua/fill-or-unfill-paragraph) ("C-c r" . round-number-at-point-to-decimals) - ("C-s" . isearch-forward-regexp) - ("C-r" . isearch-backward-regexp) + ("C-s" . swiper) + ("C-r" . gpolonkai/isearch-regexp) ("C-M-s" . isearch-forward) ("C-M-r" . isearch-backward) ("C-~" . toggle-char-case)