Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Emacs why can I not paste text C-y into a C-s search box?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

Follow this pattern:

  1. Esc-W // To copy of the selected text into buffer

  2. Ctrl-s Then press return.

  3. Ctrl-y Then press return. // To paste selected text

Then repeat Ctrl-s for incremental search. Similarly for decremental search, use Ctrl-r.

share|improve this answer
4  
Small correction: Esc-W is actually M-w (where Meta can be done with pressing ESC followed by the command key, or by pressing Alt together with the command key; all depending on configuration (and keyboard, if you happen to have a Meta key ;-))) –  Jürgen A. Erhard Jan 14 '11 at 18:43
    
Interesting trick, didn't know about pressing return when in i-search :·) –  Nikana Reklawyks Nov 18 '12 at 20:15
add comment

The command you are looking for is isearch-yank-kill which is bound to M-y when in isearch

M-y runs the command isearch-yank-kill, which is an interactive compiled Lisp function in `isearch.el'.

(isearch-yank-kill)

Pull string from kill ring into search string.

share|improve this answer
add comment

Since Emacs 24.1, you can.

C-y in Isearch is now bound to isearch-yank-kill, instead of isearch-yank-line.

(from http://www.gnu.org/software/emacs/NEWS.24.1)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.