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

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

RE: one shortcut next occurrence search


From: Drew Adams
Subject: RE: one shortcut next occurrence search
Date: Thu, 23 Dec 2010 09:12:28 -0800

> >> I would like to have a new binding so that if im having the 
> >> cursur on a word, one shortcut click (say f3) whould find
> >> the next occurrence of the word in the text and so one. 
> > 
> > What's wrong with ordinary `C-s C-w C-s C-s ...'?
>
> I want the the marked word to be found next when I hit f3. 
> maybe you'll call me lazy but `C-s C-w' is too much for me ...

The `C-w' is only to "mark" the word, i.e. to say which word(s) you want to
visit.  Thereafter, all you need is `C-s' for "the marked word to be found
next".  And you can of course use any other key you like (e.g. f3) instead of
`C-s'.

So wrt laziness: hitting `f3' to visit each occurrence is no more difficult than
hitting `f3' to visit each occurrence. ;-)

> ex1-ex2 ex3
> ex1
> ex1-ex2

For that example, if you want to visit only the `ex1-ex2' occurrences, then
start by `C-s C-w C-w'.

Another alternative, besides `C-s' and the one Tassilo mentioned, is `occur'.
You can also access `occur' from `isearch' (`C-s').

And there are `occur' variants (enhancements) that provide other behavior.
Thierry Volpiatto's `ioccur' is one.  Icicles's `C-'' is another
(`icicle-occur').  All of these (including vanilla `occur') let you not only
cycle among occurrences but also visit specific occurrences directly.

http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview#toc2
http://www.emacswiki.org/emacs/OccurMode




reply via email to

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