From ed02bd17f9efa86b1f3ec525b079f0597efc923a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 17 Dec 2014 20:15:59 +0000 Subject: Emacs: Add and bind isearch-yank-symbol --- tag-emacs/emacs.d/init.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el index a407e67c..b7ebbefc 100644 --- a/tag-emacs/emacs.d/init.el +++ b/tag-emacs/emacs.d/init.el @@ -1011,6 +1011,21 @@ mouse-1: Display Line and Column Mode Menu")))))) (bind-key "S-SPC" #'set-mark-command) +(defun fc/isearch-yank-symbol () + "Yank the symbol at point into the isearch minibuffer. + +C-w does something similar in isearch, but it only looks for +the rest of the word. I want to look for the whole string. And +symbol, not word, as I need this for programming the most." + (interactive) + (isearch-yank-string + (save-excursion + (when (and (not isearch-forward) + isearch-other-end) + (goto-char isearch-other-end)) + (thing-at-point 'symbol)))) +(bind-key "C-d" #'fc/isearch-yank-symbol isearch-mode-map) + (req-package subword :init (global-subword-mode t)) -- cgit 1.4.1