I didn’t spend too much time testing the Find features in the editor, as I was more focused on core editing and Microsoft IntelliSense functionality. However, there were times when I helped to analyze test-case failures, assisted in the full test pass, or just did what we call a bug bash, where the test team devotes an entire working day (if not the entire 24 hours) to try to find as many bugs as possible.
You can categorize searching within the editor into three buckets: keyboard searches, quick searches, and advanced searches. The keyboard searches tend to be the fastest, involving the least amount of interaction with the user interface (UI), but they can be limited in scope. The quick searches are your multipurpose searches. But, depending on what you are searching for and where you want to look for it, there may be a more efficient job search. And finally, the advanced searches—namely, Find In Files—are your Swiss army knife of search functionality, especially when you need to search anywhere for anything on the hard drive.
The tips covered in this section are designed to limit the amount of UI you need to interact with to conduct a search. Avoiding UI interactions tends to save time, especially when you are repeating the action frequently throughout the day.
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:
Press Ctrl+I.
Start typing the text you are searching for.
Press Ctrl+I again to jump to the next occurrence of the search string.
Additionally, you can press Ctrl+Shift+I to search backward.
To stop searching, press Esc. You’ll see confirmation in the status bar that you are out of the incremental search mode.
These next tips illustrate what you can do and what you can customize when searching a currently-selected word.
Just select some text (or just have the cursor on the word you want to search for) and press Ctrl+F3. Ctrl+Shift+F3 will do a reverse search.
Note that a Ctrl+F3 search uses the following options:
Is case sensitive
Searches hidden text
Allows for partial matching
Does not use regular expressions
Go to the Tools–Options–Environment–Find And Replace page, and uncheck the Automatically Populate Find What With Text From The Editor option.
Now, when you hit Ctrl+F (Quick Find) or Ctrl+Shift+F (Find In Files) or Ctrl+H (Quick Replace), the Find What combo box will not automatically display the current word or selected text.
Reducing the number of necessary keystrokes in a commonly repeated action saves time in the long run. Repeating the last search is definitely one of the ways you can take advantage of this philosophy. Instead of having to redo the last search, which may take several keystrokes and even involve using the UI, you can press a single keyboard shortcut to search what you last searched for.
Obviously, you can press the Find Next button in the Find And Replace window. But you can also press F3 to search for the next instance, and Shift+F3 searches for the previous instance of the search string.
Note that this keyboard shortcut is only for Quick Find and Find In Files, not for an incremental search.
18.117.148.177