Using Incremental Search


Versions Supported:  2008,2010

Keyboard Shortcut:  CTRL + I

Menu Command:  Edit -> Advanced -> Incremental Search

Video:  http://vstricks.com/tricks/001/

Publish Date:  1/1/2010

Tip Code:  vstipFind0001

 

Incremental search is a powerful search to use when you want to keep both your focus and your cursor in the editor when searching in the current document. It is powerful because it allows you to keep typing, meaning the search is driven by keystrokes. And you don't need to interact with any UI.

 

To conduct an incremental search, follow these steps:

  1. Press Ctrl+I.
  2. Start typing the text you are searching for.  You'll see the cursor jump to the first match, highlighting the current search string:
    image
  3. If you look in the lower-left corner of your screen you will see an indication that you are doing an Incremental Search:
    image
  4. Press Ctrl+I again to jump to the next occurrence of the search string:
    image

 

Here are all the options you can leverage while in this mode:

To

Use

Move to the next match in the file

CTRL+I

Reverse the direction of the search

CTRL+SHIFT+I

Remove a character from the search string

BACKSPACE

Stop the incremental search

ESC

Comments (2)
  1. Ben says:

    What would be great is if incremental search could be used for selection, as in Emacs and probably many other editors. The work flow is:

    1. With the cursor at the beginning of what you want to select, place a "mark". A mark is just a placeholder that marks the beginning of the selection.

    2. Use incremental search to move the cursor to the end of what you want to select. How everything between the mark and the search location is selected.

    3. Do whatever you want with the selection (delete, format, etc.).

    As far as I can tell, this isn’t possible with the VS editor.

  2. Ben says:

    That should have been, "Now everything between the mark and the search location is selected."

Comments are closed.

Skip to main content