Eclipse: Incremental Find…

GOSH! I just wasted a solid hour trying to remember what Eclipse called their “vi style search/find” find feature. I remembered learning about the “vi” style find a few weeks ago (it was on EclipseZone), but could not remember how to get into the find mode. FYI. If you are looking for it, Eclipse calls it Incremental Find.

Anyhow, the two ways to activate Incremental Find in Eclipse are:
-via the menu system with Edit -> Incremental Find Next or Incremental Find Previous.
-via keyboard shortcut Ctrl-J for forward find and Ctrl-Shift-J for reverse find.

A couple notes on incremental find “odd” behaviors. The first is that when you are searching forward the text you are searching for is highlighted and your cursor is at the end of the string you are searching for. The odd part of this is that if I want to search in an opposite direction, from forward to reverse, the first time I switch the direction my search doesn’t move from one instance of the search term to the next. My cursor just stays on the same search term but moves from the beginning of the term to the end. Yes, I’m being anal here, but it seems like an inefficient movement, just moving the cursor, not moving to the next search term.

Along the lines of the first “odd” behavior. When using incremental find to search for something, and you hit the end of the file, the find doesn’t wrap. The find just lets you know that you hit the end. Then with a second keystroke it wraps to the next search term. I call this “blocking my shot”.

It would be nice if Incremental Find in Eclipse worked a bit more like vi but it’s still a great feature and one that I will be using going forward. And, the main point of this post was to document how to use incremental find, and what it’s actually called (not “the vi kind of find”) so I can talk about it with people.

4 Responses to “Eclipse: Incremental Find…”

  1. Tom Says:

    And in Vim, it’s called “incsearch” where “inc” means incremental. So Eclipse isn’t too different in its terminology. (And old-timey vi doesn’t have it.) Anyway, I agree that it’s useful.

  2. Erik Weibust Says:

    Howdy Tom,

    Thanks for stopping by. I agree that incremental search in Eclipse is very similar to that feature in vim, but in vim the search simply wraps when it hits the bottom of the document, or when you switch directions.

    Erik

  3. Frank Merenda Says:

    Nice! I had no idea, and I’ve been using eclipse for over a year now!

    Take care,
    -Frank

  4. Endre Stølsvik Says:

    Both of those features are of course really cool: If you’re searching for a long string, moving to the front of that string is nice to do with just “one additional stroke”. Being informed in rather subtle way that you’re wrapping is of is also nice, so that you don’t believe you’re still searching downward: you’ve actually wrapped.

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image