summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index a407e67..b7ebbef 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))