all repos — nixfiles @ ed02bd17f9efa86b1f3ec525b079f0597efc923a

System and user configuration, managed by nix and home-manager

Emacs: Add and bind isearch-yank-symbol

Alan Pearce
commit

ed02bd17f9efa86b1f3ec525b079f0597efc923a

parent

083f8933424fc276a1575029a266223ef44f63bf

1 file changed, 15 insertions(+), 0 deletions(-)

jump to
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -1011,6 +1011,21 @@ (delete-selection-mode t)
(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))