From 407f1b1f8ee014a289dc82e3aceceb671d6b1076 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 22 Mar 2017 23:23:38 +0100 Subject: [PATCH] Mark search result upon exiting isearch with S-return --- init.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.el b/init.el index 46491e5..3cca0b4 100644 --- a/init.el +++ b/init.el @@ -1123,6 +1123,7 @@ ("M-k" . gpolonkai/undo-buffer-kill) :map isearch-mode-map ("" . isearch-exit-other-end) + ("" . isearch-exit-mark-match) :map gpolonkai/pers-map ("m" . hidden-mode-line-mode) ("C-i e" . "gergely@polonkai.eu") @@ -1140,6 +1141,14 @@ (isearch-exit) (goto-char isearch-other-end)) +;; Kudos goes to http://emacs.stackexchange.com/a/31321/507 +(defun isearch-exit-mark-match () + "Exit isearch and mark the current match." + (interactive) + (isearch-exit) + (push-mark isearch-other-end) + (activate-mark)) + ;; Set up some global minor modes (global-prettify-symbols-mode t)