Customize how search results are displayed

Wednesday, September 23, 2009 Labels: ,

I created a simple utility that can customize the Visual Studio Find Results output. I think using it should be pretty self-explanatory..

VSFindResultsEditor

I wanted something new to do this morning, what can I say!?

Download it here!

 

You can also check out Sara Ford’s blog for all the glorious details about customizing the Visual Studio Find Results output:

http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx

Excellent Visual Studio tips roundup by Sara Ford

http://blogs.msdn.com/saraford/archive/2009/09/09/teched-australia-25-visual-studio-2008-ide-tips.aspx

 

The ones I found most useful (or didn’t already know) include:

Prevent copying blank lines with Ctrl+C

Look in Tools - Options - Text Editor - All Languages - General. Unchecking 'Apply Cut or Copy commands to blank lines when there is no selection' prevents copying a blank line into the clipboard.  How did I ever miss this checkbox!?

 

Incremental Search

This allows me to jump to the next match as I type it out. I LOVE it!!

   1. Press Ctrl+I
   2. Start typing the text you are searching for.  note: you'll see the cursor jump to the first match, highlighting the current search string.
   3. Press Ctrl+I again to jump to the next occurrence of the search string
   4. (advanced tip) Press Ctrl+Shift+I to search backwards
   5. To stop searching, press ESC

You’ll note that it is case-sensitive, unfortunately. I’ll have to look for a way to change that..

 

And, my total favorite is..

Customize how search results are displayed

This is one of the most irritating things ever about Visual Studio. The Find Results window is almost always filled with only the paths of the found files, instead of the line details. I always have to scroll to the right to see the details. Here is the direct link to the article, bypassing the roundup.

http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx

The Windows Vista UAC

Monday, March 19, 2007 Labels: , ,
Everyone has probably already turned off the UAC, but I hadn't until today. I left those annoying popup dialogs, because I actually like the features it provides; not for me, but for when my kids are using my computer. And, let's be honest, once you had everything installed that you normally use, the popup dialog isn't really that annoying anymore.

Today I found a way to disable the UAC dialogs for only Administrators. That is cool! I haven't seen that done yet, so I tried it out and it works good! You can look here for the instructions to perform this tip, courtesy of HowToGeek.com.


Alternatively, you can create a plain-text file on your computer, name it with a .REG extension and put the following into it.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"ConsentPromptBehaviorAdmin"=dword:00000000


Then, run that file. This registry key location was also courtesy of HowToGeek.com.

Windows Vista Command-Prompt from Here

Friday, March 9, 2007 Labels: , ,
I stumbled upon a nice feature of Windows Vista Explorer. If you right-click on a folder in Explorer, it will provide you with a different set of options. One of them is "Open Command Window Here," that opens a DOS prompt with the selected folder as the default path. That is cool, since the Windows XP Command-Prompt Here PowerToy was invaluable.

UPDATED: After looking at it again, I noticed that there is one other additional item that is present when holding the Shift key down: "Copy As Path," which simply copies that folder's complete path into the Clipboard. Cool!

Here's a screen shot:

Visual Studio File Comparison Settings

Wednesday, March 7, 2007 Labels: , , ,
.. In other words, how to set Beyond Compare as your file comparison tool in VSTS.

I finally got tired of the default comparison tool in Visual Studio 2005 Team Edition and went poking around to find out how to set Beyond Compare to the default instead. The default utility (WinDiff, I think?) is extremely irritating after having used BC for so many years now.

So, on the Tools | Options dialog, click on Source Control, then Visual Studio Team Foundation Server. Now, click on the "Configure User Tools..." button. Take a look at this screen shot:



The important things to notice are the Extension and Arguments settings. The Extension specifies which files this viewer configuration will be applied to. While the Arguments are specific to the viewer application itself, in this case Beyond Compare. You can change the extension (for instance, to .cs) to apply that configuration to only those file types.

Compare settings:

Extension: .*
Operation: Compare
Command: C:\Program Files\Beyond Compare 2\BC2.exe
Arguments: %1 %2 /title1=%6 /title2=%7

Merge settings:

Extension: .*
Operation: Merge
Command: C:\Program Files\Beyond Compare 2\BC2.exe
Arguments: %1 %2 /savetarget=%4 /title1=%6 /title2=%7


(Disclaimer: I have no ties whatsoever to Scooter Software, the makers of Beyond Compare.)

The url CSS property and other frequent CSS pitfalls

Monday, January 22, 2007 Labels: ,
I noticed that I have been using the url CSS property incorrectly in a lot of our pages. The correct syntax includes single quotes around the image path. For instance:

<td style="background:url(/Controls/images/rel_calc_chooser_b.gif) repeat-x;"></td>

should be:

<td style="background:url('/Controls/images/rel_calc_chooser_b.gif') repeat-x;"></td>

Although, it usually doesn’t cause a problem with Internet Explorer and Firefox 2.0, it can cause some real mischief in older versions of Firefox and current versions of Opera and Safari. I am probably the worst at this, because I simply forget to type them or am usually copying and pasting paths and images into the editor.

I’ve also noticed several other common mistakes as well.
  • Url paths in CSS files are relative to the stylesheet, not the calling document
  • Missing pound sign before hex colors
  • Hex colors that aren’t 3 or 6 characters long
  • Not including a generic font in font-family attributes (i.e.: font-family: Tahoma, Arial, sans-serif)
I'm horrible about putting in a generic font in my styles.

Tracking down CSS-caused issues is usually a head-ache and quite often a nightmare. The Firefox console provides detailed CSS errors along with the JavaScript errors. It is a good habit to review the console watching for these errors when making changes.

By the way, I found a great utility to clean up and streamline CSS code at http://www.cleancss.com/.
Older Posts