Visual Studio Tip: Customizing Search Output in Visual Studio

Play Visual Studio Tip: Customizing Search Output in Visual Studio
Sign in to queue


When you do a Find in Files (CTRL+SHIFT+F), by default the output displays the file path which can fill up the results window. Did you know you can use a registry key to customize the output of your search?

Just create a string value in the registry called "Find result format" put it in HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Find  (12.0 for VS 2013, 11.0 for VS2012, 10.0 for VS2010) then specify a value for your new registry string value of $f$e($l,$c):$t\r\n   This will display file name file extension (line number column number): line of code containing the string match and then inserts a carriage return.

The end result? Simpler search results (as long as you don't need the file path)



Download this episode

The Discussion

  • User profile image

    Is there a way to only get a part of the path from the solution root folder?

  • User profile image

    Cool. This really does need to go on the options dialog.

    One question (without trying it): does this mean you can't click on the path to open the file? Because if that still works, then it's the best thing ever. If not then I'd (personally) keep the need to scroll to the right if it means I can open the file.

  • User profile image


    Thank you. Very useful.

    Can we apply the same tip to "Find Symbol Results" - ctrl+k+r ? If so, can you please tell me what will be the correspondent Folder for the action "Find Symbol Results"?



  • User profile image

    JohnLudlow, yes, you can still click to open the file.

    If you prefer a PowerShell script:

    Set-ItemProperty HKCU:\Software\Microsoft\VisualStudio\12.0\Find -Name 'Find result format' -Type String -Value '$f$e($l,$c):$t\r\n'

    -Jon Tims [MSFT]


  • User profile image

    @JonTims: Sweet 

    Yeah the PowerShell script is better for copy-past-iness.

    And yes, @dudumanbogda​nvlad raises a good point that this would be useful in the Find Symbol / Find References windows

  • User profile image

    BTW, I found this blog post which explains what the different specifiers mean:

    This is the format I've started using:


    It's mostly the same, but I've added some tabs to separate the file name from the match, and used $s instead of $t because it seems to trim out any leading spaces from the match. This (IMHO) leads to a more regular list of matches which is less randomly spaced.

    Thanks for the tip

  • User profile image

    You guys are off and running with this! Thanks for sharing the powershell script!

  • User profile image

    Very helpful. Thank you for posting.

Add Your 2 Cents