Last active
December 16, 2015 05:59
-
-
Save dgutov/5388082 to your computer and use it in GitHub Desktop.
Make isearch default to the current selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun isearch-use-region-when-active () | |
(when (region-active-p) | |
(setq mark-active nil) | |
(setq isearch-lazy-highlight-last-string nil) | |
(isearch-yank-string | |
(buffer-substring (region-beginning) (region-end))))) | |
(add-hook 'isearch-mode-hook 'isearch-use-region-when-active) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment