help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regex search - easy keystroke for next?


From: Deniz Dogan
Subject: Re: regex search - easy keystroke for next?
Date: Tue, 3 May 2011 18:42:26 +0200

2011/5/3 AngusC <anguscomber@gmail.com>:
>
>
> Deniz Dogan-3 wrote:
>>
>> 2011/5/3 AngusC <anguscomber@gmail.com>:
>>>
>>> Hello
>>>
>>> Am I correct in thinking that if you use a regex search ie C-M-s, if you
>>> are
>>> on first instance found, you have to type same keystroke AGAIN to get to
>>> next instance?  But that is quite a keystroke.  Is there not a next key?
>>>  n
>>> or something similar?
>>>
>>> Couldn't find on internet search.  Let me know.
>>>
>>> Thanks.
>>>
>>> Angus
>>>
>>
>> Actually, you can just use C-s and C-r to go to the next or previous
>> match as long as you've used C-M-s the first time. If you want other
>> keys than that you'd have to modify isearch-mode-map.
>>
>>
> Great, thanks.  It is so much less awkward than spanning the three keys :)
>

Since I'm bored, I wrote something for you:

(define-key isearch-mode-map (kbd "n") 'isearch-repeat-forward)
(define-key isearch-mode-map (kbd "p") 'isearch-repeat-backward)

Put that in your ~/.emacs and you will be able to use 'n' to repeat
the search forward and 'p' for backward.

-- 
Deniz Dogan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]