When doing a yank
after an isearch-forward/backward
, the most natural thing that one wishes to happen is to isearch the string provided by that yank. How to realize this?
You say:
Recently I have installed the packages isearch+ when I remove the line
(require 'isearch+)
from my init file, the problem is solved.
@kaushalmodi said:
Search for what
C-y
is bound to in theisearch-mode-map
by isearch+.
and
Check that package's documentation in its header; by design you need to hit
C-y C-y
to do the usual yank:;;
C-y C-y
isearch-yank-kill
.
By default, C-y
is a prefix key in Isearch+. There are multiple yank commands, all bound to keys on prefix C-y
. C-y C-y
is bound by default to isearch-yank-kill
.
You can of course bind any key you like (in isearch-mode-map
) to any Isearch command, including to isearch-yank-kill
:
(define-key isearch-mode-map (kbd "WHATEVER") 'isearch-yank-kill)
FYI -- You can not only get this info from the isearch+.el library file header, as @kaushalmodi pointed out. You can also use C-s C-h
to see all bindings in the Isearch-mode keymap. And if you use library help-fns+.el then you can also use C-h M-k isearch-mode-map
to see a human-readable description of all of the keys and their commands.
C-s C-y
, it'll yank text into the minibuffer, and isearch will search the text in the buffer for the yanked text. – zck Jul 29 '15 at 17:31C-y
two times to achieve this (i.e.C-s C-y C-y
). But the natural thing is to pressC-s C-y
as you said. I have the impression that it is because when doingC-s
the minibuffer is not in focus. – Name Jul 29 '15 at 17:41C-s C-y
definitely works for me. I'm using Emacs 24.4; how about you? Does it also not work starting fromemacs -Q
? – zck Jul 29 '15 at 17:47C-y
is bound to in theisearch-mode-map
byisearch+
. Keeping this question might be useful for people facing the same confusion. You can answer your own question. – Kaushal Modi Jul 29 '15 at 18:02C-y C-y
to do the usualyank
:;; `C-y C-y' `isearch-yank-kill'
. – Kaushal Modi Jul 29 '15 at 18:04