Skip to main content
Don't use bind-key
Source Link
glucas
  • 20.9k
  • 1
  • 56
  • 84

Here's one approach:

(defun isearch-exit-mark-match ()
  "Exit isearch and mark the current match."
  (interactive)
  (isearch-exit)
  (push-mark isearch-other-end)
  (activate-mark))

(binddefine-key isearch-mode-map (kbd "<C-return>") #'isearch-exit-mark-match isearch-mode-map)

This binds a different key (C-return) to exit the current isearch and also leave the last match selected. This will work with isearch-forward-regexp as well, which is handy.

Here's one approach:

(defun isearch-exit-mark-match ()
  "Exit isearch and mark the current match."
  (interactive)
  (isearch-exit)
  (push-mark isearch-other-end)
  (activate-mark))

(bind-key "<C-return>" #'isearch-exit-mark-match isearch-mode-map)

This binds a different key (C-return) to exit the current isearch and also leave the last match selected. This will work with isearch-forward-regexp as well, which is handy.

Here's one approach:

(defun isearch-exit-mark-match ()
  "Exit isearch and mark the current match."
  (interactive)
  (isearch-exit)
  (push-mark isearch-other-end)
  (activate-mark))

(define-key isearch-mode-map (kbd "<C-return>") #'isearch-exit-mark-match)

This binds a different key (C-return) to exit the current isearch and also leave the last match selected. This will work with isearch-forward-regexp as well, which is handy.

added 69 characters in body
Source Link
glucas
  • 20.9k
  • 1
  • 56
  • 84

Here's one approach:

(defun isearch-exit-mark-match ()
  "Exit isearch and mark the current match."
  (interactive)
  (isearch-exit)
  (push-mark isearch-other-end)
  (activate-mark))

(bind-key "<C-return>" #'isearch-exit-mark-match isearch-mode-map)

This binds a different key (C-return) to exit the current isearch and also leave the last match selected. This will work with isearch-forward-regexp as well, which is handy.

Here's one approach:

(defun isearch-exit-mark-match ()
  "Exit isearch and mark the current match."
  (interactive)
  (isearch-exit)
  (push-mark isearch-other-end)
  (activate-mark))

(bind-key "<C-return>" #'isearch-exit-mark-match isearch-mode-map)

This binds a different key (C-return) to exit the current isearch and also leave the last match selected.

Here's one approach:

(defun isearch-exit-mark-match ()
  "Exit isearch and mark the current match."
  (interactive)
  (isearch-exit)
  (push-mark isearch-other-end)
  (activate-mark))

(bind-key "<C-return>" #'isearch-exit-mark-match isearch-mode-map)

This binds a different key (C-return) to exit the current isearch and also leave the last match selected. This will work with isearch-forward-regexp as well, which is handy.

Source Link
glucas
  • 20.9k
  • 1
  • 56
  • 84

Here's one approach:

(defun isearch-exit-mark-match ()
  "Exit isearch and mark the current match."
  (interactive)
  (isearch-exit)
  (push-mark isearch-other-end)
  (activate-mark))

(bind-key "<C-return>" #'isearch-exit-mark-match isearch-mode-map)

This binds a different key (C-return) to exit the current isearch and also leave the last match selected.