Visual Studio has a lot of options, that allow you to customize the tools to individual user needs. Thanks to this, your daily work are becoming more enjoyable and more effective. Unfortunately, if you want to change the way of search result presentation you will encounter the problem. The Visual Studio settings do not contain such option, which would allow to change it. I wonder how many people is annoyed by the standard layout of search results window.

Default search result window

From my experience I can say that, the path to the file is not needed. Very often it is a long inscription, which in most cases is the same. It seems to me, that those are working on the project will need just the file name, which very often is the name of the class. Instead of the layout presented above, I suggest the following:

Customized search result window

This view was reached after several attempts. Initially I left at the end the path to the file. However, it proved to be unnecessary, because it has not been used by me, and further darkened the results obtained.

I suggest to remove the path for people, who work with Visual Studio on notebook. Each saved inch of screen space is at a premium.

Let’s get to the details. Changing the appearance of the search windows require changes in the registry. So,, please run the registry editor and navigate to the key: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\Find.

Please find there, or create if it does not exist, key named Find Result Format and enter the value: $f$e($l):$t\r\n. This change will appear immediately, without re-launching Visual Studio.

If the results of this customisation are not sufficient results window can be further customized by changing the value of the specified key. You can use the following elements to build custom search results window:

  1. Files
    • $p – path
    • $f – filename
    • $v – drive / unc share
    • $d – directory
    • $n – name
    • $e – .ext
  2. Location
    • $l – line
    • $c – column
    • $x – end column if on first line, else end of first line
    • $L – span end line
    • $C – span end column
  3. Text
    • $0 – matched text
    • $t – text of first line
    • $s – summary of hit
    • $T – text of spanned lines
  4. Char
    • \n – newline
    • \s – space
    • \t – tab
    • \\ – slash
    • \$ – $